diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.AutoSDKHttpResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.AutoSDKHttpResponse.g.cs new file mode 100644 index 000000000..5bfdd3129 --- /dev/null +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Google.Gemini +{ + /// + /// 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/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs index da677294a..9394f1322 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs @@ -52,6 +52,26 @@ partial void ProcessBatchesCancelResponseContent( string batchesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchesCancelAsResponseAsync( + batchesId: batchesId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`. + /// + /// + /// 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> BatchesCancelAsResponseAsync( + string batchesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessBatchesCancelResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/batches/{batchesId}:cancel", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessBatchesCancelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessBatchesCancelResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessBatchesCancelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessBatchesCancelResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessBatchesCancelResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessBatchesCancelResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessBatchesCancelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessBatchesCancelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessBatchesCancelResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessBatchesCancelResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs index 586bf9288..906e51de5 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs @@ -52,6 +52,26 @@ partial void ProcessBatchesDeleteResponseContent( string batchesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchesDeleteAsResponseAsync( + batchesId: batchesId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + /// + /// + /// 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> BatchesDeleteAsResponseAsync( + string batchesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessBatchesDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/batches/{batchesId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessBatchesDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessBatchesDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessBatchesDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessBatchesDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessBatchesDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessBatchesDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessBatchesDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessBatchesDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessBatchesDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessBatchesDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs index 80f48d018..74e2706a8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessBatchesGetResponseContent( string batchesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchesGetAsResponseAsync( + batchesId: batchesId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// 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> BatchesGetAsResponseAsync( + string batchesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessBatchesGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/batches/{batchesId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessBatchesGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessBatchesGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessBatchesGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessBatchesGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessBatchesGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessBatchesGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessBatchesGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessBatchesGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessBatchesGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessBatchesGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs index 43d7257f1..81caee073 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs @@ -64,6 +64,35 @@ partial void ProcessBatchesListResponseContent( bool? returnPartialSuccess = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchesListAsResponseAsync( + filter: filter, + pageSize: pageSize, + pageToken: pageToken, + returnPartialSuccess: returnPartialSuccess, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// + /// + /// + /// + /// 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> BatchesListAsResponseAsync( + string? filter = default, + int? pageSize = default, + string? pageToken = default, + bool? returnPartialSuccess = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -96,6 +125,7 @@ partial void ProcessBatchesListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/batches", baseUri: HttpClient.BaseAddress); @@ -106,12 +136,12 @@ partial void ProcessBatchesListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("pageSize", pageSize?.ToString()) .AddOptionalParameter("pageToken", pageToken) - .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant()) + .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -169,6 +199,8 @@ partial void ProcessBatchesListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +211,11 @@ partial void ProcessBatchesListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -196,6 +233,8 @@ partial void ProcessBatchesListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +244,7 @@ partial void ProcessBatchesListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +253,11 @@ partial void ProcessBatchesListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -231,14 +274,15 @@ partial void ProcessBatchesListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +322,8 @@ partial void ProcessBatchesListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +344,8 @@ partial void ProcessBatchesListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -322,9 +370,13 @@ partial void ProcessBatchesListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -352,9 +404,13 @@ partial void ProcessBatchesListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs index 167bf45e0..35ccf0698 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs @@ -57,6 +57,34 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( public async global::System.Threading.Tasks.Task BatchesUpdateEmbedContentBatchAsync( string batchesId, + global::Google.Gemini.EmbedContentBatch request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchesUpdateEmbedContentBatchAsResponseAsync( + batchesId: batchesId, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates a batch of EmbedContent requests for batch 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> BatchesUpdateEmbedContentBatchAsResponseAsync( + string batchesId, + global::Google.Gemini.EmbedContentBatch request, string? updateMask = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, @@ -94,6 +122,7 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/batches/{batchesId}:updateEmbedContentBatch", baseUri: HttpClient.BaseAddress); @@ -104,9 +133,9 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("updateMask", updateMask) + .AddOptionalParameter("updateMask", updateMask) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -169,6 +198,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +210,11 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -196,6 +232,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +243,7 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +252,11 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -231,14 +273,15 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +321,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +343,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -322,9 +369,13 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.EmbedContentBatch.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.EmbedContentBatch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -352,9 +403,13 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.EmbedContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.EmbedContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,21 +452,21 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( /// /// /// + /// + /// Stats about the batch. + /// /// /// Required. The user-defined name of this batch. /// + /// + /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. + /// /// /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. /// /// /// Configures the input to the batch request. /// - /// - /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. - /// - /// - /// Stats about the batch. - /// /// /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// @@ -421,22 +476,22 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent( public async global::System.Threading.Tasks.Task BatchesUpdateEmbedContentBatchAsync( string batchesId, string? updateMask = default, + global::Google.Gemini.EmbedContentBatchStats? batchStats = default, string? displayName = default, + global::Google.Gemini.EmbedContentBatchOutput? output = default, string? model = default, global::Google.Gemini.InputEmbedContentConfig? inputConfig = default, - global::Google.Gemini.EmbedContentBatchOutput? output = default, - global::Google.Gemini.EmbedContentBatchStats? batchStats = default, string? priority = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.EmbedContentBatch { + BatchStats = batchStats, DisplayName = displayName, + Output = output, Model = model, InputConfig = inputConfig, - Output = output, - BatchStats = batchStats, Priority = priority, }; diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs index fcc2c8327..05b8d8019 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs @@ -57,6 +57,34 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( public async global::System.Threading.Tasks.Task BatchesUpdateGenerateContentBatchAsync( string batchesId, + global::Google.Gemini.GenerateContentBatch request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchesUpdateGenerateContentBatchAsResponseAsync( + batchesId: batchesId, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates a batch of GenerateContent requests for batch 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> BatchesUpdateGenerateContentBatchAsResponseAsync( + string batchesId, + global::Google.Gemini.GenerateContentBatch request, string? updateMask = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, @@ -94,6 +122,7 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/batches/{batchesId}:updateGenerateContentBatch", baseUri: HttpClient.BaseAddress); @@ -104,9 +133,9 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("updateMask", updateMask) + .AddOptionalParameter("updateMask", updateMask) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -169,6 +198,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +210,11 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -196,6 +232,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +243,7 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +252,11 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -231,14 +273,15 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +321,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +343,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -322,9 +369,13 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.GenerateContentBatch.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.GenerateContentBatch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -352,9 +403,13 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.GenerateContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.GenerateContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -403,18 +458,18 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( /// /// Configures the input to the batch request. /// - /// - /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. - /// - /// - /// Required. The user-defined name of this batch. - /// /// /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// /// /// Stats about the batch. /// + /// + /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. + /// + /// + /// Required. The user-defined name of this batch. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -423,10 +478,10 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( string? updateMask = default, string? model = default, global::Google.Gemini.InputConfig? inputConfig = default, - global::Google.Gemini.GenerateContentBatchOutput? output = default, - string? displayName = default, string? priority = default, global::Google.Gemini.BatchStats? batchStats = default, + global::Google.Gemini.GenerateContentBatchOutput? output = default, + string? displayName = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -434,10 +489,10 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent( { Model = model, InputConfig = inputConfig, - Output = output, - DisplayName = displayName, Priority = priority, BatchStats = batchStats, + Output = output, + DisplayName = displayName, }; return await BatchesUpdateGenerateContentBatchAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs index 9f4111fdd..3ad2dbc64 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs @@ -50,6 +50,28 @@ partial void ProcessCachedContentsCreateResponseContent( /// public async global::System.Threading.Tasks.Task CachedContentsCreateAsync( + global::Google.Gemini.CachedContent request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CachedContentsCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Creates CachedContent resource. + /// + /// + /// 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> CachedContentsCreateAsResponseAsync( + global::Google.Gemini.CachedContent request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessCachedContentsCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/cachedContents", baseUri: HttpClient.BaseAddress); @@ -154,6 +177,8 @@ partial void ProcessCachedContentsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +189,11 @@ partial void ProcessCachedContentsCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +211,8 @@ partial void ProcessCachedContentsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +222,7 @@ partial void ProcessCachedContentsCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +231,11 @@ partial void ProcessCachedContentsCreateResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +252,15 @@ partial void ProcessCachedContentsCreateResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +300,8 @@ partial void ProcessCachedContentsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +322,8 @@ partial void ProcessCachedContentsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +348,13 @@ partial void ProcessCachedContentsCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +382,13 @@ partial void ProcessCachedContentsCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -380,60 +429,60 @@ partial void ProcessCachedContentsCreateResponseContent( /// /// Creates CachedContent resource. /// - /// - /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. + /// + /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response + /// + /// + /// Input only. New TTL for this resource, input only. /// /// /// Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}` /// - /// - /// Optional. Input only. Immutable. The content to cache. + /// + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// /// /// The Tool configuration containing parameters for specifying `Tool` use in the request. /// - /// - /// Input only. New TTL for this resource, input only. + /// + /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. /// /// /// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. /// - /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. + /// + /// Optional. Input only. Immutable. The content to cache. /// /// /// Metadata on the usage of the cached content. /// - /// - /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next 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 CachedContentsCreateAsync( - string? expireTime = default, + global::System.Collections.Generic.IList? tools = default, + string? ttl = default, string? model = default, - global::System.Collections.Generic.IList? contents = default, + global::Google.Gemini.Content? systemInstruction = default, global::Google.Gemini.ToolConfig? toolConfig = default, - string? ttl = default, + string? expireTime = default, string? displayName = default, - global::Google.Gemini.Content? systemInstruction = default, + global::System.Collections.Generic.IList? contents = default, global::Google.Gemini.CachedContentUsageMetadata? usageMetadata = default, - global::System.Collections.Generic.IList? tools = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.CachedContent { - ExpireTime = expireTime, + Tools = tools, + Ttl = ttl, Model = model, - Contents = contents, + SystemInstruction = systemInstruction, ToolConfig = toolConfig, - Ttl = ttl, + ExpireTime = expireTime, DisplayName = displayName, - SystemInstruction = systemInstruction, + Contents = contents, UsageMetadata = usageMetadata, - Tools = tools, }; return await CachedContentsCreateAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs index 066a5d13c..4dd3726c2 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs @@ -52,6 +52,26 @@ partial void ProcessCachedContentsDeleteResponseContent( string cachedContentsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CachedContentsDeleteAsResponseAsync( + cachedContentsId: cachedContentsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes CachedContent resource. + /// + /// + /// 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> CachedContentsDeleteAsResponseAsync( + string cachedContentsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessCachedContentsDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/cachedContents/{cachedContentsId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessCachedContentsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessCachedContentsDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessCachedContentsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessCachedContentsDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessCachedContentsDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessCachedContentsDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessCachedContentsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessCachedContentsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessCachedContentsDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessCachedContentsDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs index 00547b378..85cea00ac 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessCachedContentsGetResponseContent( string cachedContentsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CachedContentsGetAsResponseAsync( + cachedContentsId: cachedContentsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reads CachedContent resource. + /// + /// + /// 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> CachedContentsGetAsResponseAsync( + string cachedContentsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessCachedContentsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/cachedContents/{cachedContentsId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessCachedContentsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessCachedContentsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessCachedContentsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessCachedContentsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessCachedContentsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessCachedContentsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessCachedContentsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessCachedContentsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessCachedContentsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessCachedContentsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs index 9597aa657..4e3589577 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs @@ -56,6 +56,29 @@ partial void ProcessCachedContentsListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CachedContentsListAsResponseAsync( + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists CachedContents. + /// + /// + /// + /// 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> CachedContentsListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessCachedContentsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/cachedContents", baseUri: HttpClient.BaseAddress); @@ -96,10 +120,10 @@ partial void ProcessCachedContentsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -155,6 +179,8 @@ partial void ProcessCachedContentsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +191,11 @@ partial void ProcessCachedContentsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +213,8 @@ partial void ProcessCachedContentsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +224,7 @@ partial void ProcessCachedContentsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +233,11 @@ partial void ProcessCachedContentsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +254,15 @@ partial void ProcessCachedContentsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +302,8 @@ partial void ProcessCachedContentsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +324,8 @@ partial void ProcessCachedContentsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +350,13 @@ partial void ProcessCachedContentsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListCachedContentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListCachedContentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +384,13 @@ partial void ProcessCachedContentsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListCachedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListCachedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs index a936b016a..ebede5eff 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs @@ -57,6 +57,34 @@ partial void ProcessCachedContentsPatchResponseContent( public async global::System.Threading.Tasks.Task CachedContentsPatchAsync( string cachedContentsId, + global::Google.Gemini.CachedContent request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CachedContentsPatchAsResponseAsync( + cachedContentsId: cachedContentsId, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates CachedContent resource (only expiration is updatable). + /// + /// + /// + /// + /// 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> CachedContentsPatchAsResponseAsync( + string cachedContentsId, + global::Google.Gemini.CachedContent request, string? updateMask = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, @@ -94,6 +122,7 @@ partial void ProcessCachedContentsPatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/cachedContents/{cachedContentsId}", baseUri: HttpClient.BaseAddress); @@ -104,9 +133,9 @@ partial void ProcessCachedContentsPatchResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("updateMask", updateMask) + .AddOptionalParameter("updateMask", updateMask) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -169,6 +198,8 @@ partial void ProcessCachedContentsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +210,11 @@ partial void ProcessCachedContentsPatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -196,6 +232,8 @@ partial void ProcessCachedContentsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +243,7 @@ partial void ProcessCachedContentsPatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +252,11 @@ partial void ProcessCachedContentsPatchResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -231,14 +273,15 @@ partial void ProcessCachedContentsPatchResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +321,8 @@ partial void ProcessCachedContentsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +343,8 @@ partial void ProcessCachedContentsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -322,9 +369,13 @@ partial void ProcessCachedContentsPatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -352,9 +403,13 @@ partial void ProcessCachedContentsPatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,62 +452,62 @@ partial void ProcessCachedContentsPatchResponseContent( /// /// /// - /// - /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. + /// + /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response + /// + /// + /// Input only. New TTL for this resource, input only. /// /// /// Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}` /// - /// - /// Optional. Input only. Immutable. The content to cache. + /// + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// /// /// The Tool configuration containing parameters for specifying `Tool` use in the request. /// - /// - /// Input only. New TTL for this resource, input only. + /// + /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. /// /// /// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. /// - /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. + /// + /// Optional. Input only. Immutable. The content to cache. /// /// /// Metadata on the usage of the cached content. /// - /// - /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next 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 CachedContentsPatchAsync( string cachedContentsId, string? updateMask = default, - string? expireTime = default, + global::System.Collections.Generic.IList? tools = default, + string? ttl = default, string? model = default, - global::System.Collections.Generic.IList? contents = default, + global::Google.Gemini.Content? systemInstruction = default, global::Google.Gemini.ToolConfig? toolConfig = default, - string? ttl = default, + string? expireTime = default, string? displayName = default, - global::Google.Gemini.Content? systemInstruction = default, + global::System.Collections.Generic.IList? contents = default, global::Google.Gemini.CachedContentUsageMetadata? usageMetadata = default, - global::System.Collections.Generic.IList? tools = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.CachedContent { - ExpireTime = expireTime, + Tools = tools, + Ttl = ttl, Model = model, - Contents = contents, + SystemInstruction = systemInstruction, ToolConfig = toolConfig, - Ttl = ttl, + ExpireTime = expireTime, DisplayName = displayName, - SystemInstruction = systemInstruction, + Contents = contents, UsageMetadata = usageMetadata, - Tools = tools, }; return await CachedContentsPatchAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs index 861e55d34..973b89975 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs @@ -50,6 +50,28 @@ partial void ProcessCorporaCreateResponseContent( /// public async global::System.Threading.Tasks.Task CorporaCreateAsync( + global::Google.Gemini.Corpus request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Creates an empty `Corpus`. + /// + /// + /// 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> CorporaCreateAsResponseAsync( + global::Google.Gemini.Corpus request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessCorporaCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/corpora", baseUri: HttpClient.BaseAddress); @@ -154,6 +177,8 @@ partial void ProcessCorporaCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +189,11 @@ partial void ProcessCorporaCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +211,8 @@ partial void ProcessCorporaCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +222,7 @@ partial void ProcessCorporaCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +231,11 @@ partial void ProcessCorporaCreateResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +252,15 @@ partial void ProcessCorporaCreateResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +300,8 @@ partial void ProcessCorporaCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +322,8 @@ partial void ProcessCorporaCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +348,13 @@ partial void ProcessCorporaCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +382,13 @@ partial void ProcessCorporaCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs index 4d92dfc2d..23ae5a377 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs @@ -56,6 +56,29 @@ partial void ProcessCorporaDeleteResponseContent( bool? force = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaDeleteAsResponseAsync( + corporaId: corporaId, + force: force, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes a `Corpus`. + /// + /// + /// + /// 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> CorporaDeleteAsResponseAsync( + string corporaId, + bool? force = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessCorporaDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}", baseUri: HttpClient.BaseAddress); @@ -96,9 +120,9 @@ partial void ProcessCorporaDeleteResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) + .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -154,6 +178,8 @@ partial void ProcessCorporaDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +190,11 @@ partial void ProcessCorporaDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +212,8 @@ partial void ProcessCorporaDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +223,7 @@ partial void ProcessCorporaDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +232,11 @@ partial void ProcessCorporaDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +253,15 @@ partial void ProcessCorporaDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +301,8 @@ partial void ProcessCorporaDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +323,8 @@ partial void ProcessCorporaDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +349,13 @@ partial void ProcessCorporaDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +383,13 @@ partial void ProcessCorporaDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs index 28ed1f9f2..bd7f702e8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessCorporaGetResponseContent( string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaGetAsResponseAsync( + corporaId: corporaId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets information about a specific `Corpus`. + /// + /// + /// 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> CorporaGetAsResponseAsync( + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessCorporaGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessCorporaGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessCorporaGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessCorporaGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessCorporaGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessCorporaGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessCorporaGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessCorporaGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessCorporaGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessCorporaGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessCorporaGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs index 8439103a9..3e2f9f336 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs @@ -56,6 +56,29 @@ partial void ProcessCorporaListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaListAsResponseAsync( + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists all `Corpora` owned by 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> CorporaListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessCorporaListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/corpora", baseUri: HttpClient.BaseAddress); @@ -96,10 +120,10 @@ partial void ProcessCorporaListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -155,6 +179,8 @@ partial void ProcessCorporaListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +191,11 @@ partial void ProcessCorporaListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +213,8 @@ partial void ProcessCorporaListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +224,7 @@ partial void ProcessCorporaListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +233,11 @@ partial void ProcessCorporaListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +254,15 @@ partial void ProcessCorporaListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +302,8 @@ partial void ProcessCorporaListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +324,8 @@ partial void ProcessCorporaListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +350,13 @@ partial void ProcessCorporaListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListCorporaResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListCorporaResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +384,13 @@ partial void ProcessCorporaListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListCorporaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListCorporaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs index 787a4a1a7..6630a0a7b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessCorporaOperationsGetResponseContent( string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaOperationsGetAsResponseAsync( + operationsId: operationsId, + corporaId: corporaId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> CorporaOperationsGetAsResponseAsync( + string operationsId, + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessCorporaOperationsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}/operations/{operationsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessCorporaOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessCorporaOperationsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessCorporaOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessCorporaOperationsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessCorporaOperationsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessCorporaOperationsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessCorporaOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessCorporaOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessCorporaOperationsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessCorporaOperationsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs index ebe07e6fc..e7da42d85 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs @@ -54,6 +54,31 @@ partial void ProcessCorporaPermissionsCreateResponseContent( public async global::System.Threading.Tasks.Task CorporaPermissionsCreateAsync( string corporaId, + global::Google.Gemini.Permission request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaPermissionsCreateAsResponseAsync( + corporaId: corporaId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a permission to a specific resource. + /// + /// + /// + /// 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> CorporaPermissionsCreateAsResponseAsync( + string corporaId, + global::Google.Gemini.Permission request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessCorporaPermissionsCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}/permissions", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessCorporaPermissionsCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessCorporaPermissionsCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessCorporaPermissionsCreateResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessCorporaPermissionsCreateResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessCorporaPermissionsCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessCorporaPermissionsCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,31 +439,31 @@ partial void ProcessCorporaPermissionsCreateResponseContent( /// Create a permission to a specific resource. /// /// - /// - /// Required. The role granted by this permission. - /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// 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 CorporaPermissionsCreateAsync( string corporaId, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.Permission { - Role = role, GranteeType = granteeType, EmailAddress = emailAddress, + Role = role, }; return await CorporaPermissionsCreateAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs index b02decf6c..28d7ac642 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs @@ -56,6 +56,29 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaPermissionsDeleteAsResponseAsync( + permissionsId: permissionsId, + corporaId: corporaId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes the permission. + /// + /// + /// + /// 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> CorporaPermissionsDeleteAsResponseAsync( + string permissionsId, + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}/permissions/{permissionsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessCorporaPermissionsDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs index f991f64e7..b4a0eb019 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessCorporaPermissionsGetResponseContent( string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaPermissionsGetAsResponseAsync( + permissionsId: permissionsId, + corporaId: corporaId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets information about a specific Permission. + /// + /// + /// + /// 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> CorporaPermissionsGetAsResponseAsync( + string permissionsId, + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessCorporaPermissionsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}/permissions/{permissionsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessCorporaPermissionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessCorporaPermissionsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessCorporaPermissionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessCorporaPermissionsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessCorporaPermissionsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessCorporaPermissionsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessCorporaPermissionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessCorporaPermissionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessCorporaPermissionsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessCorporaPermissionsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs index bce88c14e..3496c6c87 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs @@ -60,6 +60,32 @@ partial void ProcessCorporaPermissionsListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaPermissionsListAsResponseAsync( + corporaId: corporaId, + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists permissions for the specific resource. + /// + /// + /// + /// + /// 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> CorporaPermissionsListAsResponseAsync( + string corporaId, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -91,6 +117,7 @@ partial void ProcessCorporaPermissionsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}/permissions", baseUri: HttpClient.BaseAddress); @@ -101,10 +128,10 @@ partial void ProcessCorporaPermissionsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -161,6 +188,8 @@ partial void ProcessCorporaPermissionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -171,6 +200,11 @@ partial void ProcessCorporaPermissionsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -188,6 +222,8 @@ partial void ProcessCorporaPermissionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -197,8 +233,7 @@ partial void ProcessCorporaPermissionsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -207,6 +242,11 @@ partial void ProcessCorporaPermissionsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -223,14 +263,15 @@ partial void ProcessCorporaPermissionsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -270,6 +311,8 @@ partial void ProcessCorporaPermissionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -290,6 +333,8 @@ partial void ProcessCorporaPermissionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -314,9 +359,13 @@ partial void ProcessCorporaPermissionsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListPermissionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListPermissionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -344,9 +393,13 @@ partial void ProcessCorporaPermissionsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListPermissionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListPermissionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs index 4a40647fd..cad014241 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs @@ -61,6 +61,37 @@ partial void ProcessCorporaPermissionsPatchResponseContent( string permissionsId, string corporaId, + global::Google.Gemini.Permission request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CorporaPermissionsPatchAsResponseAsync( + permissionsId: permissionsId, + corporaId: corporaId, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates the permission. + /// + /// + /// + /// + /// + /// 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> CorporaPermissionsPatchAsResponseAsync( + string permissionsId, + string corporaId, + global::Google.Gemini.Permission request, string? updateMask = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, @@ -99,6 +130,7 @@ partial void ProcessCorporaPermissionsPatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/corpora/{corporaId}/permissions/{permissionsId}", baseUri: HttpClient.BaseAddress); @@ -109,9 +141,9 @@ partial void ProcessCorporaPermissionsPatchResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("updateMask", updateMask) + .AddOptionalParameter("updateMask", updateMask) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -175,6 +207,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +219,11 @@ partial void ProcessCorporaPermissionsPatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +241,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +252,7 @@ partial void ProcessCorporaPermissionsPatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +261,11 @@ partial void ProcessCorporaPermissionsPatchResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +282,15 @@ partial void ProcessCorporaPermissionsPatchResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +330,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +352,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -328,9 +378,13 @@ partial void ProcessCorporaPermissionsPatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -358,9 +412,13 @@ partial void ProcessCorporaPermissionsPatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -404,15 +462,15 @@ partial void ProcessCorporaPermissionsPatchResponseContent( /// /// /// - /// - /// Required. The role granted by this permission. - /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -420,17 +478,17 @@ partial void ProcessCorporaPermissionsPatchResponseContent( string permissionsId, string corporaId, string? updateMask = default, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.Permission { - Role = role, GranteeType = granteeType, EmailAddress = emailAddress, + Role = role, }; return await CorporaPermissionsPatchAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs index ae85044ff..52e50eddb 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessDynamicGenerateContentResponseContent( public async global::System.Threading.Tasks.Task DynamicGenerateContentAsync( string dynamicId, + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DynamicGenerateContentAsResponseAsync( + dynamicId: dynamicId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + /// + /// + /// + /// 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> DynamicGenerateContentAsResponseAsync( + string dynamicId, + global::Google.Gemini.GenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessDynamicGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/dynamic/{dynamicId}:generateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessDynamicGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessDynamicGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessDynamicGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessDynamicGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessDynamicGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessDynamicGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessDynamicGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessDynamicGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessDynamicGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessDynamicGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,66 +439,66 @@ partial void ProcessDynamicGenerateContentResponseContent( /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 DynamicGenerateContentAsync( string dynamicId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; return await DynamicGenerateContentAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs index 1cdac0679..d31ccfc05 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( public async global::System.Threading.Tasks.Task DynamicStreamGenerateContentAsync( string dynamicId, + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DynamicStreamGenerateContentAsResponseAsync( + dynamicId: dynamicId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. + /// + /// + /// + /// 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> DynamicStreamGenerateContentAsResponseAsync( + string dynamicId, + global::Google.Gemini.GenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/dynamic/{dynamicId}:streamGenerateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,66 +439,66 @@ partial void ProcessDynamicStreamGenerateContentResponseContent( /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 DynamicStreamGenerateContentAsync( string dynamicId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; return await DynamicStreamGenerateContentAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs index 9d3514422..862a9a375 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs @@ -84,6 +84,7 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/dynamic/{dynamicId}:streamGenerateContent", baseUri: HttpClient.BaseAddress); @@ -155,6 +156,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +168,11 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +190,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +201,7 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +210,11 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +231,15 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +279,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +301,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -360,66 +379,66 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse( /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 DynamicStreamGenerateContentAsStreamAsync( string dynamicId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; var __enumerable = DynamicStreamGenerateContentAsStreamAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs index 06509fe63..22ea3ac6c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs @@ -50,6 +50,28 @@ partial void ProcessFileSearchStoresCreateResponseContent( /// public async global::System.Threading.Tasks.Task FileSearchStoresCreateAsync( + global::Google.Gemini.FileSearchStore request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Creates an empty `FileSearchStore`. + /// + /// + /// 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> FileSearchStoresCreateAsResponseAsync( + global::Google.Gemini.FileSearchStore request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessFileSearchStoresCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/fileSearchStores", baseUri: HttpClient.BaseAddress); @@ -154,6 +177,8 @@ partial void ProcessFileSearchStoresCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +189,11 @@ partial void ProcessFileSearchStoresCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +211,8 @@ partial void ProcessFileSearchStoresCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +222,7 @@ partial void ProcessFileSearchStoresCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +231,11 @@ partial void ProcessFileSearchStoresCreateResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +252,15 @@ partial void ProcessFileSearchStoresCreateResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +300,8 @@ partial void ProcessFileSearchStoresCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +322,8 @@ partial void ProcessFileSearchStoresCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +348,13 @@ partial void ProcessFileSearchStoresCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +382,13 @@ partial void ProcessFileSearchStoresCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs index 2b47229d5..f50d4a6ab 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs @@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresDeleteResponseContent( bool? force = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresDeleteAsResponseAsync( + fileSearchStoresId: fileSearchStoresId, + force: force, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes a `FileSearchStore`. + /// + /// + /// + /// 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> FileSearchStoresDeleteAsResponseAsync( + string fileSearchStoresId, + bool? force = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}", baseUri: HttpClient.BaseAddress); @@ -96,9 +120,9 @@ partial void ProcessFileSearchStoresDeleteResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) + .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -154,6 +178,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +190,11 @@ partial void ProcessFileSearchStoresDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +212,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +223,7 @@ partial void ProcessFileSearchStoresDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +232,11 @@ partial void ProcessFileSearchStoresDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +253,15 @@ partial void ProcessFileSearchStoresDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +301,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +323,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +349,13 @@ partial void ProcessFileSearchStoresDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +383,13 @@ partial void ProcessFileSearchStoresDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs index e711942c7..69e35977a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs @@ -60,6 +60,32 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( bool? force = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresDocumentsDeleteAsResponseAsync( + fileSearchStoresId: fileSearchStoresId, + documentsId: documentsId, + force: force, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes a `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> FileSearchStoresDocumentsDeleteAsResponseAsync( + string fileSearchStoresId, + string documentsId, + bool? force = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -91,6 +117,7 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", baseUri: HttpClient.BaseAddress); @@ -101,9 +128,9 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) + .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -160,6 +187,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +199,11 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +221,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +232,7 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +241,11 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +262,15 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +310,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +332,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +358,13 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +392,13 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs index b888ab22b..a5bc674f5 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( string documentsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresDocumentsGetAsResponseAsync( + fileSearchStoresId: fileSearchStoresId, + documentsId: documentsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets information about a specific `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> FileSearchStoresDocumentsGetAsResponseAsync( + string fileSearchStoresId, + string documentsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Document.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Document.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs index 89330b58b..fea2c4c7f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs @@ -60,6 +60,32 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresDocumentsListAsResponseAsync( + fileSearchStoresId: fileSearchStoresId, + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists all `Document`s in a `Corpus`. + /// + /// + /// + /// + /// 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> FileSearchStoresDocumentsListAsResponseAsync( + string fileSearchStoresId, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -91,6 +117,7 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}/documents", baseUri: HttpClient.BaseAddress); @@ -101,10 +128,10 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -161,6 +188,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -171,6 +200,11 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -188,6 +222,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -197,8 +233,7 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -207,6 +242,11 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -223,14 +263,15 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -270,6 +311,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -290,6 +333,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -314,9 +359,13 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListDocumentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListDocumentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -344,9 +393,13 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs index 329ad3d3c..d3efcc130 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessFileSearchStoresGetResponseContent( string fileSearchStoresId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresGetAsResponseAsync( + fileSearchStoresId: fileSearchStoresId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets information about a specific `FileSearchStore`. + /// + /// + /// 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> FileSearchStoresGetAsResponseAsync( + string fileSearchStoresId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessFileSearchStoresGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessFileSearchStoresGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessFileSearchStoresGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessFileSearchStoresGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessFileSearchStoresGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessFileSearchStoresGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessFileSearchStoresGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessFileSearchStoresGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessFileSearchStoresGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessFileSearchStoresGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessFileSearchStoresGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs index e43ae79a3..2f8953417 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs @@ -54,6 +54,31 @@ partial void ProcessFileSearchStoresImportFileResponseContent( public async global::System.Threading.Tasks.Task FileSearchStoresImportFileAsync( string fileSearchStoresId, + global::Google.Gemini.ImportFileRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresImportFileAsResponseAsync( + fileSearchStoresId: fileSearchStoresId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Imports a `File` from File Service to a `FileSearchStore`. + /// + /// + /// + /// 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> FileSearchStoresImportFileAsResponseAsync( + string fileSearchStoresId, + global::Google.Gemini.ImportFileRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessFileSearchStoresImportFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}:importFile", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessFileSearchStoresImportFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessFileSearchStoresImportFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessFileSearchStoresImportFileResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessFileSearchStoresImportFileResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessFileSearchStoresImportFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessFileSearchStoresImportFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,31 +439,31 @@ partial void ProcessFileSearchStoresImportFileResponseContent( /// Imports a `File` from File Service to a `FileSearchStore`. /// /// - /// - /// Custom metadata to be associated with the file. + /// + /// Required. The name of the `File` to import. Example: `files/abc-123` /// /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto /// - /// - /// Required. The name of the `File` to import. Example: `files/abc-123` + /// + /// Custom metadata to be associated with the 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 FileSearchStoresImportFileAsync( string fileSearchStoresId, - global::System.Collections.Generic.IList? customMetadata = default, - global::Google.Gemini.ChunkingConfig? chunkingConfig = default, string? fileName = default, + global::Google.Gemini.ChunkingConfig? chunkingConfig = default, + global::System.Collections.Generic.IList? customMetadata = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.ImportFileRequest { - CustomMetadata = customMetadata, - ChunkingConfig = chunkingConfig, FileName = fileName, + ChunkingConfig = chunkingConfig, + CustomMetadata = customMetadata, }; return await FileSearchStoresImportFileAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs index 344fa4dd4..d18e08ce6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs @@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresListAsResponseAsync( + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists all `FileSearchStores` owned by 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> FileSearchStoresListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/fileSearchStores", baseUri: HttpClient.BaseAddress); @@ -96,10 +120,10 @@ partial void ProcessFileSearchStoresListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -155,6 +179,8 @@ partial void ProcessFileSearchStoresListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +191,11 @@ partial void ProcessFileSearchStoresListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +213,8 @@ partial void ProcessFileSearchStoresListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +224,7 @@ partial void ProcessFileSearchStoresListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +233,11 @@ partial void ProcessFileSearchStoresListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +254,15 @@ partial void ProcessFileSearchStoresListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +302,8 @@ partial void ProcessFileSearchStoresListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +324,8 @@ partial void ProcessFileSearchStoresListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +350,13 @@ partial void ProcessFileSearchStoresListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListFileSearchStoresResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListFileSearchStoresResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +384,13 @@ partial void ProcessFileSearchStoresListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListFileSearchStoresResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListFileSearchStoresResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs index 473e7eb0c..88e4c2227 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( string fileSearchStoresId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresOperationsGetAsResponseAsync( + operationsId: operationsId, + fileSearchStoresId: fileSearchStoresId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> FileSearchStoresOperationsGetAsResponseAsync( + string operationsId, + string fileSearchStoresId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs index b65a9f0a9..8b07669fe 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( string fileSearchStoresId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FileSearchStoresUploadOperationsGetAsResponseAsync( + operationsId: operationsId, + fileSearchStoresId: fileSearchStoresId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> FileSearchStoresUploadOperationsGetAsResponseAsync( + string operationsId, + string fileSearchStoresId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs index e94c3f8fe..cf7d15254 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs @@ -52,6 +52,26 @@ partial void ProcessFilesDeleteResponseContent( string filesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FilesDeleteAsResponseAsync( + filesId: filesId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes the `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> FilesDeleteAsResponseAsync( + string filesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessFilesDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/files/{filesId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessFilesDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessFilesDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessFilesDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessFilesDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessFilesDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessFilesDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessFilesDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessFilesDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessFilesDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessFilesDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs index f9654b778..578919ac6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessFilesGetResponseContent( string filesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FilesGetAsResponseAsync( + filesId: filesId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the metadata for the given `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> FilesGetAsResponseAsync( + string filesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessFilesGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/files/{filesId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessFilesGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessFilesGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessFilesGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessFilesGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessFilesGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessFilesGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessFilesGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessFilesGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessFilesGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.File.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.File.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessFilesGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.File.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.File.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs index 84d9db128..a70c73c45 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs @@ -56,6 +56,29 @@ partial void ProcessFilesListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FilesListAsResponseAsync( + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists the metadata for `File`s owned by the requesting project. + /// + /// + /// + /// 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> FilesListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessFilesListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/files", baseUri: HttpClient.BaseAddress); @@ -96,10 +120,10 @@ partial void ProcessFilesListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -155,6 +179,8 @@ partial void ProcessFilesListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +191,11 @@ partial void ProcessFilesListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +213,8 @@ partial void ProcessFilesListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +224,7 @@ partial void ProcessFilesListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +233,11 @@ partial void ProcessFilesListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +254,15 @@ partial void ProcessFilesListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +302,8 @@ partial void ProcessFilesListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +324,8 @@ partial void ProcessFilesListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +350,13 @@ partial void ProcessFilesListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListFilesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListFilesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +384,13 @@ partial void ProcessFilesListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs index 7f4208962..3bac9d27f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs @@ -50,6 +50,28 @@ partial void ProcessFilesRegisterResponseContent( /// public async global::System.Threading.Tasks.Task FilesRegisterAsync( + global::Google.Gemini.RegisterFilesRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FilesRegisterAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails. + /// + /// + /// 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> FilesRegisterAsResponseAsync( + global::Google.Gemini.RegisterFilesRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessFilesRegisterResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/files:register", baseUri: HttpClient.BaseAddress); @@ -154,6 +177,8 @@ partial void ProcessFilesRegisterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +189,11 @@ partial void ProcessFilesRegisterResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +211,8 @@ partial void ProcessFilesRegisterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +222,7 @@ partial void ProcessFilesRegisterResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +231,11 @@ partial void ProcessFilesRegisterResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +252,15 @@ partial void ProcessFilesRegisterResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +300,8 @@ partial void ProcessFilesRegisterResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +322,8 @@ partial void ProcessFilesRegisterResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +348,13 @@ partial void ProcessFilesRegisterResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.RegisterFilesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.RegisterFilesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +382,13 @@ partial void ProcessFilesRegisterResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.RegisterFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.RegisterFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs index d4dd9aae2..7ed45a64c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs @@ -56,6 +56,29 @@ partial void ProcessGeneratedFilesListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GeneratedFilesListAsResponseAsync( + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists the generated files owned by the requesting project. + /// + /// + /// + /// 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> GeneratedFilesListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessGeneratedFilesListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/generatedFiles", baseUri: HttpClient.BaseAddress); @@ -96,10 +120,10 @@ partial void ProcessGeneratedFilesListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -155,6 +179,8 @@ partial void ProcessGeneratedFilesListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +191,11 @@ partial void ProcessGeneratedFilesListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +213,8 @@ partial void ProcessGeneratedFilesListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +224,7 @@ partial void ProcessGeneratedFilesListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +233,11 @@ partial void ProcessGeneratedFilesListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +254,15 @@ partial void ProcessGeneratedFilesListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +302,8 @@ partial void ProcessGeneratedFilesListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +324,8 @@ partial void ProcessGeneratedFilesListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +350,13 @@ partial void ProcessGeneratedFilesListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListGeneratedFilesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListGeneratedFilesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +384,13 @@ partial void ProcessGeneratedFilesListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListGeneratedFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListGeneratedFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs index 80610df39..54f4957b1 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( string generatedFilesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GeneratedFilesOperationsGetAsResponseAsync( + operationsId: operationsId, + generatedFilesId: generatedFilesId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> GeneratedFilesOperationsGetAsResponseAsync( + string operationsId, + string generatedFilesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/generatedFiles/{generatedFilesId}/operations/{operationsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs index f8ffaa2a5..c80395b5d 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs @@ -50,6 +50,28 @@ partial void ProcessMediaUploadResponseContent( /// public async global::System.Threading.Tasks.Task MediaUploadAsync( + global::Google.Gemini.CreateFileRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MediaUploadAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Creates 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> MediaUploadAsResponseAsync( + global::Google.Gemini.CreateFileRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessMediaUploadResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/files", baseUri: HttpClient.BaseAddress); @@ -154,6 +177,8 @@ partial void ProcessMediaUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +189,11 @@ partial void ProcessMediaUploadResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +211,8 @@ partial void ProcessMediaUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +222,7 @@ partial void ProcessMediaUploadResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +231,11 @@ partial void ProcessMediaUploadResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +252,15 @@ partial void ProcessMediaUploadResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +300,8 @@ partial void ProcessMediaUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +322,8 @@ partial void ProcessMediaUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +348,13 @@ partial void ProcessMediaUploadResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.CreateFileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.CreateFileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +382,13 @@ partial void ProcessMediaUploadResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.CreateFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.CreateFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs index 5dc8e5e80..76b471baf 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs @@ -54,6 +54,31 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( public async global::System.Threading.Tasks.Task MediaUploadToFileSearchStoreAsync( string fileSearchStoresId, + global::Google.Gemini.UploadToFileSearchStoreRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MediaUploadToFileSearchStoreAsResponseAsync( + fileSearchStoresId: fileSearchStoresId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore 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> MediaUploadToFileSearchStoreAsResponseAsync( + string fileSearchStoresId, + global::Google.Gemini.UploadToFileSearchStoreRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.CustomLongRunningOperation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.CustomLongRunningOperation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.CustomLongRunningOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.CustomLongRunningOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,15 +439,15 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( /// Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document. /// /// - /// - /// Custom metadata to be associated with the data. - /// /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto /// /// /// Optional. Display name of the created document. /// + /// + /// Custom metadata to be associated with the data. + /// /// /// Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content. /// @@ -404,18 +456,18 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent( /// public async global::System.Threading.Tasks.Task MediaUploadToFileSearchStoreAsync( string fileSearchStoresId, - global::System.Collections.Generic.IList? customMetadata = default, global::Google.Gemini.ChunkingConfig? chunkingConfig = default, string? displayName = default, + global::System.Collections.Generic.IList? customMetadata = default, string? mimeType = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.UploadToFileSearchStoreRequest { - CustomMetadata = customMetadata, ChunkingConfig = chunkingConfig, DisplayName = displayName, + CustomMetadata = customMetadata, MimeType = mimeType, }; diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs index 76ccdaf8f..9524ea980 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( public async global::System.Threading.Tasks.Task ModelsAsyncBatchEmbedContentAsync( string modelsId, + global::Google.Gemini.AsyncBatchEmbedContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsAsyncBatchEmbedContentAsResponseAsync( + modelsId: modelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion. + /// + /// + /// + /// 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> ModelsAsyncBatchEmbedContentAsResponseAsync( + string modelsId, + global::Google.Gemini.AsyncBatchEmbedContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:asyncBatchEmbedContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs index efdf231f3..ccfc8ad98 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs @@ -54,6 +54,31 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( public async global::System.Threading.Tasks.Task ModelsBatchEmbedContentsAsync( string modelsId, + global::Google.Gemini.BatchEmbedContentsRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsBatchEmbedContentsAsResponseAsync( + modelsId: modelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects. + /// + /// + /// + /// 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> ModelsBatchEmbedContentsAsResponseAsync( + string modelsId, + global::Google.Gemini.BatchEmbedContentsRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:batchEmbedContents", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.BatchEmbedContentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.BatchEmbedContentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessModelsBatchEmbedContentsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.BatchEmbedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.BatchEmbedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs index 07b077e90..3534f3c6c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessModelsBatchGenerateContentResponseContent( public async global::System.Threading.Tasks.Task ModelsBatchGenerateContentAsync( string modelsId, + global::Google.Gemini.BatchGenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsBatchGenerateContentAsResponseAsync( + modelsId: modelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Enqueues a batch of `GenerateContent` requests for batch 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> ModelsBatchGenerateContentAsResponseAsync( + string modelsId, + global::Google.Gemini.BatchGenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessModelsBatchGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:batchGenerateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessModelsBatchGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessModelsBatchGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessModelsBatchGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessModelsBatchGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessModelsBatchGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessModelsBatchGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs index 293eab140..9a48aa82d 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs @@ -54,6 +54,31 @@ partial void ProcessModelsCountTokensResponseContent( public async global::System.Threading.Tasks.Task ModelsCountTokensAsync( string modelsId, + global::Google.Gemini.CountTokensRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsCountTokensAsResponseAsync( + modelsId: modelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens. + /// + /// + /// + /// 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> ModelsCountTokensAsResponseAsync( + string modelsId, + global::Google.Gemini.CountTokensRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessModelsCountTokensResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:countTokens", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessModelsCountTokensResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessModelsCountTokensResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessModelsCountTokensResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessModelsCountTokensResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessModelsCountTokensResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessModelsCountTokensResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessModelsCountTokensResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessModelsCountTokensResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessModelsCountTokensResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.CountTokensResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.CountTokensResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessModelsCountTokensResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.CountTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.CountTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs index 90f56f580..29ce048ad 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs @@ -56,6 +56,31 @@ partial void ProcessModelsEmbedContentResponseContent( public async global::System.Threading.Tasks.Task ModelsEmbedContentAsync( string modelsId, + global::Google.Gemini.EmbedContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsEmbedContentAsResponseAsync( + modelsId: modelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). + /// + /// + /// + /// 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> ModelsEmbedContentAsResponseAsync( + string modelsId, + global::Google.Gemini.EmbedContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +116,7 @@ partial void ProcessModelsEmbedContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:embedContent", baseUri: HttpClient.BaseAddress); @@ -162,6 +188,8 @@ partial void ProcessModelsEmbedContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -172,6 +200,11 @@ partial void ProcessModelsEmbedContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -189,6 +222,8 @@ partial void ProcessModelsEmbedContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -198,8 +233,7 @@ partial void ProcessModelsEmbedContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -208,6 +242,11 @@ partial void ProcessModelsEmbedContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -224,14 +263,15 @@ partial void ProcessModelsEmbedContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -271,6 +311,8 @@ partial void ProcessModelsEmbedContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -291,6 +333,8 @@ partial void ProcessModelsEmbedContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -315,9 +359,13 @@ partial void ProcessModelsEmbedContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.EmbedContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.EmbedContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -345,9 +393,13 @@ partial void ProcessModelsEmbedContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.EmbedContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.EmbedContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs index 8671c5c76..984aec483 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessModelsGenerateContentResponseContent( public async global::System.Threading.Tasks.Task ModelsGenerateContentAsync( string modelsId, + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsGenerateContentAsResponseAsync( + modelsId: modelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + /// + /// + /// + /// 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> ModelsGenerateContentAsResponseAsync( + string modelsId, + global::Google.Gemini.GenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessModelsGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:generateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessModelsGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessModelsGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessModelsGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessModelsGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessModelsGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessModelsGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessModelsGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessModelsGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessModelsGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessModelsGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,66 +439,66 @@ partial void ProcessModelsGenerateContentResponseContent( /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 ModelsGenerateContentAsync( string modelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; return await ModelsGenerateContentAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs index 1f29ce891..67d0011e4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessModelsGetResponseContent( string modelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsGetAsResponseAsync( + modelsId: modelsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information. + /// + /// + /// 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> ModelsGetAsResponseAsync( + string modelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessModelsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessModelsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessModelsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessModelsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessModelsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessModelsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessModelsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessModelsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessModelsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessModelsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Model.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Model.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessModelsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Model.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Model.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs index 42a38def6..ba152c3c6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs @@ -56,6 +56,29 @@ partial void ProcessModelsListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsListAsResponseAsync( + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API. + /// + /// + /// + /// 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> ModelsListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessModelsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/models", baseUri: HttpClient.BaseAddress); @@ -96,10 +120,10 @@ partial void ProcessModelsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -155,6 +179,8 @@ partial void ProcessModelsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +191,11 @@ partial void ProcessModelsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +213,8 @@ partial void ProcessModelsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +224,7 @@ partial void ProcessModelsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +233,11 @@ partial void ProcessModelsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +254,15 @@ partial void ProcessModelsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +302,8 @@ partial void ProcessModelsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +324,8 @@ partial void ProcessModelsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +350,13 @@ partial void ProcessModelsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListModelsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListModelsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +384,13 @@ partial void ProcessModelsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs index 4d6cea65c..1156ceda8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessModelsOperationsGetResponseContent( string modelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsOperationsGetAsResponseAsync( + operationsId: operationsId, + modelsId: modelsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> ModelsOperationsGetAsResponseAsync( + string operationsId, + string modelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessModelsOperationsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}/operations/{operationsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessModelsOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessModelsOperationsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessModelsOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessModelsOperationsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessModelsOperationsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessModelsOperationsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessModelsOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessModelsOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessModelsOperationsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessModelsOperationsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs index 4d6524aaf..f35c292e5 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs @@ -68,6 +68,38 @@ partial void ProcessModelsOperationsListResponseContent( bool? returnPartialSuccess = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsOperationsListAsResponseAsync( + modelsId: modelsId, + filter: filter, + pageSize: pageSize, + pageToken: pageToken, + returnPartialSuccess: returnPartialSuccess, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// + /// + /// + /// + /// + /// 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> ModelsOperationsListAsResponseAsync( + string modelsId, + string? filter = default, + int? pageSize = default, + string? pageToken = default, + bool? returnPartialSuccess = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -101,6 +133,7 @@ partial void ProcessModelsOperationsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}/operations", baseUri: HttpClient.BaseAddress); @@ -111,12 +144,12 @@ partial void ProcessModelsOperationsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("pageSize", pageSize?.ToString()) .AddOptionalParameter("pageToken", pageToken) - .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant()) + .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -175,6 +208,8 @@ partial void ProcessModelsOperationsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +220,11 @@ partial void ProcessModelsOperationsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +242,8 @@ partial void ProcessModelsOperationsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +253,7 @@ partial void ProcessModelsOperationsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +262,11 @@ partial void ProcessModelsOperationsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +283,15 @@ partial void ProcessModelsOperationsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +331,8 @@ partial void ProcessModelsOperationsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +353,8 @@ partial void ProcessModelsOperationsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -328,9 +379,13 @@ partial void ProcessModelsOperationsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -358,9 +413,13 @@ partial void ProcessModelsOperationsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs index 4fcda93f6..3f57c3d97 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessModelsStreamGenerateContentResponseContent( public async global::System.Threading.Tasks.Task ModelsStreamGenerateContentAsync( string modelsId, + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsStreamGenerateContentAsResponseAsync( + modelsId: modelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. + /// + /// + /// + /// 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> ModelsStreamGenerateContentAsResponseAsync( + string modelsId, + global::Google.Gemini.GenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessModelsStreamGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:streamGenerateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessModelsStreamGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessModelsStreamGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessModelsStreamGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessModelsStreamGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessModelsStreamGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessModelsStreamGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,66 +439,66 @@ partial void ProcessModelsStreamGenerateContentResponseContent( /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 ModelsStreamGenerateContentAsync( string modelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; return await ModelsStreamGenerateContentAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs index dcd8f9462..cdf8cdb97 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs @@ -84,6 +84,7 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/models/{modelsId}:streamGenerateContent", baseUri: HttpClient.BaseAddress); @@ -155,6 +156,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +168,11 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +190,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +201,7 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +210,11 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +231,15 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +279,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +301,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -360,66 +379,66 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse( /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 ModelsStreamGenerateContentAsStreamAsync( string modelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; var __enumerable = ModelsStreamGenerateContentAsStreamAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs index 168d8267b..8293d35fc 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( public async global::System.Threading.Tasks.Task TunedModelsAsyncBatchEmbedContentAsync( string tunedModelsId, + global::Google.Gemini.AsyncBatchEmbedContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsAsyncBatchEmbedContentAsResponseAsync( + tunedModelsId: tunedModelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion. + /// + /// + /// + /// 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> TunedModelsAsyncBatchEmbedContentAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.AsyncBatchEmbedContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}:asyncBatchEmbedContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs index 2f1f3af62..7adc1bb51 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( public async global::System.Threading.Tasks.Task TunedModelsBatchGenerateContentAsync( string tunedModelsId, + global::Google.Gemini.BatchGenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsBatchGenerateContentAsResponseAsync( + tunedModelsId: tunedModelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Enqueues a batch of `GenerateContent` requests for batch 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> TunedModelsBatchGenerateContentAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.BatchGenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}:batchGenerateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs index 039dc27aa..8bf55405b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs @@ -53,6 +53,31 @@ partial void ProcessTunedModelsCreateResponseContent( /// public async global::System.Threading.Tasks.Task TunedModelsCreateAsync( + global::Google.Gemini.TunedModel request, + string? tunedModelId = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsCreateAsResponseAsync( + + request: request, + tunedModelId: tunedModelId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 + /// + /// + /// + /// 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> TunedModelsCreateAsResponseAsync( + global::Google.Gemini.TunedModel request, string? tunedModelId = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, @@ -89,6 +114,7 @@ partial void ProcessTunedModelsCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/tunedModels", baseUri: HttpClient.BaseAddress); @@ -99,9 +125,9 @@ partial void ProcessTunedModelsCreateResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("tunedModelId", tunedModelId) + .AddOptionalParameter("tunedModelId", tunedModelId) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -163,6 +189,8 @@ partial void ProcessTunedModelsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +201,11 @@ partial void ProcessTunedModelsCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -190,6 +223,8 @@ partial void ProcessTunedModelsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -199,8 +234,7 @@ partial void ProcessTunedModelsCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -209,6 +243,11 @@ partial void ProcessTunedModelsCreateResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -225,14 +264,15 @@ partial void ProcessTunedModelsCreateResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +312,8 @@ partial void ProcessTunedModelsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +334,8 @@ partial void ProcessTunedModelsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -316,9 +360,13 @@ partial void ProcessTunedModelsCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -346,9 +394,13 @@ partial void ProcessTunedModelsCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -390,61 +442,61 @@ partial void ProcessTunedModelsCreateResponseContent( /// Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 /// /// - /// - /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - /// - /// - /// Optional. List of project numbers that have read access to the tuned model. - /// /// /// Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. - /// - /// - /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. + /// + /// Optional. A short description of this model. /// /// /// Tuning tasks that create tuned models. /// + /// + /// Tuned model as a source for training a new model. + /// + /// + /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// /// /// Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` /// - /// - /// Optional. A short description of this model. + /// + /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Tuned model as a source for training a new model. + /// + /// Optional. List of project numbers that have read access to the tuned model. + /// + /// + /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. /// /// 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 TunedModelsCreateAsync( string? tunedModelId = default, - string? displayName = default, - global::System.Collections.Generic.IList? readerProjectNumbers = default, float? topP = default, - int? topK = default, - float? temperature = default, - global::Google.Gemini.TuningTask? tuningTask = default, - string? baseModel = default, string? description = default, + global::Google.Gemini.TuningTask? tuningTask = default, global::Google.Gemini.TunedModelSource? tunedModelSource = default, + int? topK = default, + string? baseModel = default, + float? temperature = default, + global::System.Collections.Generic.IList? readerProjectNumbers = default, + string? displayName = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.TunedModel { - DisplayName = displayName, - ReaderProjectNumbers = readerProjectNumbers, TopP = topP, - TopK = topK, - Temperature = temperature, - TuningTask = tuningTask, - BaseModel = baseModel, Description = description, + TuningTask = tuningTask, TunedModelSource = tunedModelSource, + TopK = topK, + BaseModel = baseModel, + Temperature = temperature, + ReaderProjectNumbers = readerProjectNumbers, + DisplayName = displayName, }; return await TunedModelsCreateAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsDelete.g.cs index 7f8a38a83..2f456b86b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsDelete.g.cs @@ -52,6 +52,26 @@ partial void ProcessTunedModelsDeleteResponseContent( string tunedModelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsDeleteAsResponseAsync( + tunedModelsId: tunedModelsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes a 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> TunedModelsDeleteAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessTunedModelsDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessTunedModelsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessTunedModelsDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessTunedModelsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessTunedModelsDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessTunedModelsDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessTunedModelsDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessTunedModelsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessTunedModelsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessTunedModelsDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessTunedModelsDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGenerateContent.g.cs index 5582811c1..2c9f6c8c6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessTunedModelsGenerateContentResponseContent( public async global::System.Threading.Tasks.Task TunedModelsGenerateContentAsync( string tunedModelsId, + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsGenerateContentAsResponseAsync( + tunedModelsId: tunedModelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + /// + /// + /// + /// 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> TunedModelsGenerateContentAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.GenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessTunedModelsGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}:generateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessTunedModelsGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessTunedModelsGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessTunedModelsGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessTunedModelsGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessTunedModelsGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessTunedModelsGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessTunedModelsGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessTunedModelsGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessTunedModelsGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessTunedModelsGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,66 +439,66 @@ partial void ProcessTunedModelsGenerateContentResponseContent( /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 TunedModelsGenerateContentAsync( string tunedModelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; return await TunedModelsGenerateContentAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGet.g.cs index c1465ed5e..acb98410f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessTunedModelsGetResponseContent( string tunedModelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsGetAsResponseAsync( + tunedModelsId: tunedModelsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets information about a specific TunedModel. + /// + /// + /// 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> TunedModelsGetAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessTunedModelsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}", baseUri: HttpClient.BaseAddress); @@ -145,6 +166,8 @@ partial void ProcessTunedModelsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -155,6 +178,11 @@ partial void ProcessTunedModelsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -172,6 +200,8 @@ partial void ProcessTunedModelsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -181,8 +211,7 @@ partial void ProcessTunedModelsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -191,6 +220,11 @@ partial void ProcessTunedModelsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -207,14 +241,15 @@ partial void ProcessTunedModelsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +289,8 @@ partial void ProcessTunedModelsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -274,6 +311,8 @@ partial void ProcessTunedModelsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,9 +337,13 @@ partial void ProcessTunedModelsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.TunedModel.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.TunedModel.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -328,9 +371,13 @@ partial void ProcessTunedModelsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.TunedModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.TunedModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsList.g.cs index 1a98fad07..5164f64e6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsList.g.cs @@ -60,6 +60,32 @@ partial void ProcessTunedModelsListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsListAsResponseAsync( + filter: filter, + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists created tuned models. + /// + /// + /// + /// + /// 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> TunedModelsListAsResponseAsync( + string? filter = default, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -91,6 +117,7 @@ partial void ProcessTunedModelsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: "/tunedModels", baseUri: HttpClient.BaseAddress); @@ -101,11 +128,11 @@ partial void ProcessTunedModelsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -162,6 +189,8 @@ partial void ProcessTunedModelsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -172,6 +201,11 @@ partial void ProcessTunedModelsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -189,6 +223,8 @@ partial void ProcessTunedModelsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -198,8 +234,7 @@ partial void ProcessTunedModelsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -208,6 +243,11 @@ partial void ProcessTunedModelsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -224,14 +264,15 @@ partial void ProcessTunedModelsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -271,6 +312,8 @@ partial void ProcessTunedModelsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -291,6 +334,8 @@ partial void ProcessTunedModelsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -315,9 +360,13 @@ partial void ProcessTunedModelsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListTunedModelsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListTunedModelsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -345,9 +394,13 @@ partial void ProcessTunedModelsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListTunedModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListTunedModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsGet.g.cs index c04def49d..276c76124 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessTunedModelsOperationsGetResponseContent( string operationsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsOperationsGetAsResponseAsync( + tunedModelsId: tunedModelsId, + operationsId: operationsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> TunedModelsOperationsGetAsResponseAsync( + string tunedModelsId, + string operationsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessTunedModelsOperationsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}/operations/{operationsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessTunedModelsOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessTunedModelsOperationsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessTunedModelsOperationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessTunedModelsOperationsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessTunedModelsOperationsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessTunedModelsOperationsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessTunedModelsOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessTunedModelsOperationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessTunedModelsOperationsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessTunedModelsOperationsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsList.g.cs index 102ca5b8f..fe5c2e403 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsOperationsList.g.cs @@ -68,6 +68,38 @@ partial void ProcessTunedModelsOperationsListResponseContent( bool? returnPartialSuccess = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsOperationsListAsResponseAsync( + tunedModelsId: tunedModelsId, + filter: filter, + pageSize: pageSize, + pageToken: pageToken, + returnPartialSuccess: returnPartialSuccess, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// + /// + /// + /// + /// + /// 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> TunedModelsOperationsListAsResponseAsync( + string tunedModelsId, + string? filter = default, + int? pageSize = default, + string? pageToken = default, + bool? returnPartialSuccess = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -101,6 +133,7 @@ partial void ProcessTunedModelsOperationsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}/operations", baseUri: HttpClient.BaseAddress); @@ -111,12 +144,12 @@ partial void ProcessTunedModelsOperationsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("filter", filter) .AddOptionalParameter("pageSize", pageSize?.ToString()) .AddOptionalParameter("pageToken", pageToken) - .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant()) + .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -175,6 +208,8 @@ partial void ProcessTunedModelsOperationsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +220,11 @@ partial void ProcessTunedModelsOperationsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +242,8 @@ partial void ProcessTunedModelsOperationsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +253,7 @@ partial void ProcessTunedModelsOperationsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +262,11 @@ partial void ProcessTunedModelsOperationsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +283,15 @@ partial void ProcessTunedModelsOperationsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +331,8 @@ partial void ProcessTunedModelsOperationsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +353,8 @@ partial void ProcessTunedModelsOperationsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -328,9 +379,13 @@ partial void ProcessTunedModelsOperationsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -358,9 +413,13 @@ partial void ProcessTunedModelsOperationsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPatch.g.cs index 80f2ecb4a..0383c9b2f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPatch.g.cs @@ -57,6 +57,34 @@ partial void ProcessTunedModelsPatchResponseContent( public async global::System.Threading.Tasks.Task TunedModelsPatchAsync( string tunedModelsId, + global::Google.Gemini.TunedModel request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsPatchAsResponseAsync( + tunedModelsId: tunedModelsId, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates a 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> TunedModelsPatchAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.TunedModel request, string? updateMask = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, @@ -94,6 +122,7 @@ partial void ProcessTunedModelsPatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}", baseUri: HttpClient.BaseAddress); @@ -104,9 +133,9 @@ partial void ProcessTunedModelsPatchResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("updateMask", updateMask) + .AddOptionalParameter("updateMask", updateMask) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -169,6 +198,8 @@ partial void ProcessTunedModelsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +210,11 @@ partial void ProcessTunedModelsPatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -196,6 +232,8 @@ partial void ProcessTunedModelsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +243,7 @@ partial void ProcessTunedModelsPatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +252,11 @@ partial void ProcessTunedModelsPatchResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -231,14 +273,15 @@ partial void ProcessTunedModelsPatchResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +321,8 @@ partial void ProcessTunedModelsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +343,8 @@ partial void ProcessTunedModelsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -322,9 +369,13 @@ partial void ProcessTunedModelsPatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.TunedModel.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.TunedModel.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -352,9 +403,13 @@ partial void ProcessTunedModelsPatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.TunedModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.TunedModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,32 +452,32 @@ partial void ProcessTunedModelsPatchResponseContent( /// /// /// - /// - /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - /// - /// - /// Optional. List of project numbers that have read access to the tuned model. - /// /// /// Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. - /// - /// - /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. + /// + /// Optional. A short description of this model. /// /// /// Tuning tasks that create tuned models. /// + /// + /// Tuned model as a source for training a new model. + /// + /// + /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// /// /// Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` /// - /// - /// Optional. A short description of this model. + /// + /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Tuned model as a source for training a new model. + /// + /// Optional. List of project numbers that have read access to the tuned model. + /// + /// + /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -430,29 +485,29 @@ partial void ProcessTunedModelsPatchResponseContent( public async global::System.Threading.Tasks.Task TunedModelsPatchAsync( string tunedModelsId, string? updateMask = default, - string? displayName = default, - global::System.Collections.Generic.IList? readerProjectNumbers = default, float? topP = default, - int? topK = default, - float? temperature = default, - global::Google.Gemini.TuningTask? tuningTask = default, - string? baseModel = default, string? description = default, + global::Google.Gemini.TuningTask? tuningTask = default, global::Google.Gemini.TunedModelSource? tunedModelSource = default, + int? topK = default, + string? baseModel = default, + float? temperature = default, + global::System.Collections.Generic.IList? readerProjectNumbers = default, + string? displayName = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.TunedModel { - DisplayName = displayName, - ReaderProjectNumbers = readerProjectNumbers, TopP = topP, - TopK = topK, - Temperature = temperature, - TuningTask = tuningTask, - BaseModel = baseModel, Description = description, + TuningTask = tuningTask, TunedModelSource = tunedModelSource, + TopK = topK, + BaseModel = baseModel, + Temperature = temperature, + ReaderProjectNumbers = readerProjectNumbers, + DisplayName = displayName, }; return await TunedModelsPatchAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsCreate.g.cs index aac136b8c..11ebda326 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsCreate.g.cs @@ -54,6 +54,31 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( public async global::System.Threading.Tasks.Task TunedModelsPermissionsCreateAsync( string tunedModelsId, + global::Google.Gemini.Permission request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsPermissionsCreateAsResponseAsync( + tunedModelsId: tunedModelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a permission to a specific resource. + /// + /// + /// + /// 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> TunedModelsPermissionsCreateAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.Permission request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}/permissions", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,31 +439,31 @@ partial void ProcessTunedModelsPermissionsCreateResponseContent( /// Create a permission to a specific resource. /// /// - /// - /// Required. The role granted by this permission. - /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// 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 TunedModelsPermissionsCreateAsync( string tunedModelsId, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.Permission { - Role = role, GranteeType = granteeType, EmailAddress = emailAddress, + Role = role, }; return await TunedModelsPermissionsCreateAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsDelete.g.cs index 4746d9bfb..b20d46839 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsDelete.g.cs @@ -56,6 +56,29 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( string permissionsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsPermissionsDeleteAsResponseAsync( + tunedModelsId: tunedModelsId, + permissionsId: permissionsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes the permission. + /// + /// + /// + /// 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> TunedModelsPermissionsDeleteAsResponseAsync( + string tunedModelsId, + string permissionsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}/permissions/{permissionsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessTunedModelsPermissionsDeleteResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsGet.g.cs index 1e032ce2e..e3a04bbbe 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsGet.g.cs @@ -56,6 +56,29 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( string permissionsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsPermissionsGetAsResponseAsync( + tunedModelsId: tunedModelsId, + permissionsId: permissionsId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets information about a specific Permission. + /// + /// + /// + /// 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> TunedModelsPermissionsGetAsResponseAsync( + string tunedModelsId, + string permissionsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}/permissions/{permissionsId}", baseUri: HttpClient.BaseAddress); @@ -151,6 +175,8 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -161,6 +187,11 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -178,6 +209,8 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -187,8 +220,7 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -197,6 +229,11 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -213,14 +250,15 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +298,8 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -280,6 +320,8 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,9 +346,13 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -334,9 +380,13 @@ partial void ProcessTunedModelsPermissionsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsList.g.cs index 2b6f0dc7d..fb889de8f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsList.g.cs @@ -60,6 +60,32 @@ partial void ProcessTunedModelsPermissionsListResponseContent( string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsPermissionsListAsResponseAsync( + tunedModelsId: tunedModelsId, + pageSize: pageSize, + pageToken: pageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists permissions for the specific resource. + /// + /// + /// + /// + /// 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> TunedModelsPermissionsListAsResponseAsync( + string tunedModelsId, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -91,6 +117,7 @@ partial void ProcessTunedModelsPermissionsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}/permissions", baseUri: HttpClient.BaseAddress); @@ -101,10 +128,10 @@ partial void ProcessTunedModelsPermissionsListResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder .AddOptionalParameter("pageSize", pageSize?.ToString()) - .AddOptionalParameter("pageToken", pageToken) + .AddOptionalParameter("pageToken", pageToken) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -161,6 +188,8 @@ partial void ProcessTunedModelsPermissionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -171,6 +200,11 @@ partial void ProcessTunedModelsPermissionsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -188,6 +222,8 @@ partial void ProcessTunedModelsPermissionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -197,8 +233,7 @@ partial void ProcessTunedModelsPermissionsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -207,6 +242,11 @@ partial void ProcessTunedModelsPermissionsListResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -223,14 +263,15 @@ partial void ProcessTunedModelsPermissionsListResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -270,6 +311,8 @@ partial void ProcessTunedModelsPermissionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -290,6 +333,8 @@ partial void ProcessTunedModelsPermissionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -314,9 +359,13 @@ partial void ProcessTunedModelsPermissionsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.ListPermissionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.ListPermissionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -344,9 +393,13 @@ partial void ProcessTunedModelsPermissionsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.ListPermissionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.ListPermissionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsPatch.g.cs index 01045c521..7334b5848 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsPermissionsPatch.g.cs @@ -61,6 +61,37 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( string tunedModelsId, string permissionsId, + global::Google.Gemini.Permission request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsPermissionsPatchAsResponseAsync( + tunedModelsId: tunedModelsId, + permissionsId: permissionsId, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates the permission. + /// + /// + /// + /// + /// + /// 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> TunedModelsPermissionsPatchAsResponseAsync( + string tunedModelsId, + string permissionsId, + global::Google.Gemini.Permission request, string? updateMask = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, @@ -99,6 +130,7 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}/permissions/{permissionsId}", baseUri: HttpClient.BaseAddress); @@ -109,9 +141,9 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( { __pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value); } - } + } __pathBuilder - .AddOptionalParameter("updateMask", updateMask) + .AddOptionalParameter("updateMask", updateMask) ; var __path = __pathBuilder.ToString(); __path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -175,6 +207,8 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +219,11 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +241,8 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +252,7 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +261,11 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +282,15 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +330,8 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +352,8 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -328,9 +378,13 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -358,9 +412,13 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -404,15 +462,15 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( /// /// /// - /// - /// Required. The role granted by this permission. - /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -420,17 +478,17 @@ partial void ProcessTunedModelsPermissionsPatchResponseContent( string tunedModelsId, string permissionsId, string? updateMask = default, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.Permission { - Role = role, GranteeType = granteeType, EmailAddress = emailAddress, + Role = role, }; return await TunedModelsPermissionsPatchAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContent.g.cs index 85d0539e4..34e7f8a68 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContent.g.cs @@ -54,6 +54,31 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( public async global::System.Threading.Tasks.Task TunedModelsStreamGenerateContentAsync( string tunedModelsId, + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsStreamGenerateContentAsResponseAsync( + tunedModelsId: tunedModelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. + /// + /// + /// + /// 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> TunedModelsStreamGenerateContentAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.GenerateContentRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}:streamGenerateContent", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,66 +439,66 @@ partial void ProcessTunedModelsStreamGenerateContentResponseContent( /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 TunedModelsStreamGenerateContentAsync( string tunedModelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; return await TunedModelsStreamGenerateContentAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs index fd4f8290b..6e9819150 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs @@ -84,6 +84,7 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}:streamGenerateContent", baseUri: HttpClient.BaseAddress); @@ -155,6 +156,8 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +168,11 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +190,8 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +201,7 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +210,11 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +231,15 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +279,8 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +301,8 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -360,66 +379,66 @@ partial void ProcessTunedModelsStreamGenerateContentAsStreamResponse( /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 TunedModelsStreamGenerateContentAsStreamAsync( string tunedModelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Google.Gemini.GenerateContentRequest { - Contents = contents, - ToolConfig = toolConfig, - Model = model, + GenerationConfig = generationConfig, + Tools = tools, + ServiceTier = serviceTier, SystemInstruction = systemInstruction, + ToolConfig = toolConfig, CachedContent = cachedContent, - ServiceTier = serviceTier, - Tools = tools, - SafetySettings = safetySettings, - GenerationConfig = generationConfig, Store = store, + Model = model, + Contents = contents, + SafetySettings = safetySettings, }; var __enumerable = TunedModelsStreamGenerateContentAsStreamAsync( diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsTransferOwnership.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsTransferOwnership.g.cs index eddee40d3..cf161ac5c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsTransferOwnership.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsTransferOwnership.g.cs @@ -54,6 +54,31 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( public async global::System.Threading.Tasks.Task TunedModelsTransferOwnershipAsync( string tunedModelsId, + global::Google.Gemini.TransferOwnershipRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TunedModelsTransferOwnershipAsResponseAsync( + tunedModelsId: tunedModelsId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role. + /// + /// + /// + /// 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> TunedModelsTransferOwnershipAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.TransferOwnershipRequest request, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Google.Gemini.PathBuilder( path: $"/tunedModels/{tunedModelsId}:transferOwnership", baseUri: HttpClient.BaseAddress); @@ -160,6 +186,8 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +198,11 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -187,6 +220,8 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +231,7 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +240,11 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( __attempt < __maxAttempts && global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -222,14 +261,15 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( 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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +309,8 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +331,8 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -313,9 +357,13 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Google.Gemini.TransferOwnershipResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Google.Gemini.TransferOwnershipResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -343,9 +391,13 @@ partial void ProcessTunedModelsTransferOwnershipResponseContent( #endif ).ConfigureAwait(false); - return - await global::Google.Gemini.TransferOwnershipResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Google.Gemini.TransferOwnershipResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Google.Gemini.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.g.cs index 57743bcf0..9abb84bde 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.g.cs @@ -73,10 +73,10 @@ public GeminiClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public GeminiClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Google.Gemini.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Google.Gemini.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesCancel.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesCancel.g.cs index 837d3a55c..249ad31d9 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesCancel.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesCancel.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string batchesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`. + /// + /// + /// 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> BatchesCancelAsResponseAsync( + string batchesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesDelete.g.cs index 62029e7c3..2b7aef345 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesDelete.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string batchesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + /// + /// + /// 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> BatchesDeleteAsResponseAsync( + string batchesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesGet.g.cs index 5e769dc4b..842ebdf75 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesGet.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string batchesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// 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> BatchesGetAsResponseAsync( + string batchesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesList.g.cs index 8eeda673a..2b28b9792 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesList.g.cs @@ -21,5 +21,22 @@ public partial interface IGeminiClient bool? returnPartialSuccess = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// + /// + /// + /// + /// 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> BatchesListAsResponseAsync( + string? filter = default, + int? pageSize = default, + string? pageToken = default, + bool? returnPartialSuccess = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateEmbedContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateEmbedContentBatch.g.cs index 9e1fe2c23..1aa12a7e4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateEmbedContentBatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateEmbedContentBatch.g.cs @@ -25,21 +25,37 @@ public partial interface IGeminiClient /// /// /// + /// + /// 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> BatchesUpdateEmbedContentBatchAsResponseAsync( + string batchesId, + + global::Google.Gemini.EmbedContentBatch request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a batch of EmbedContent requests for batch processing. + /// + /// + /// + /// + /// Stats about the batch. + /// /// /// Required. The user-defined name of this batch. /// + /// + /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. + /// /// /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. /// /// /// Configures the input to the batch request. /// - /// - /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. - /// - /// - /// Stats about the batch. - /// /// /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// @@ -49,11 +65,11 @@ public partial interface IGeminiClient global::System.Threading.Tasks.Task BatchesUpdateEmbedContentBatchAsync( string batchesId, string? updateMask = default, + global::Google.Gemini.EmbedContentBatchStats? batchStats = default, string? displayName = default, + global::Google.Gemini.EmbedContentBatchOutput? output = default, string? model = default, global::Google.Gemini.InputEmbedContentConfig? inputConfig = default, - global::Google.Gemini.EmbedContentBatchOutput? output = default, - global::Google.Gemini.EmbedContentBatchStats? batchStats = default, string? priority = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateGenerateContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateGenerateContentBatch.g.cs index daa50e50a..8643d51fc 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateGenerateContentBatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.BatchesUpdateGenerateContentBatch.g.cs @@ -25,24 +25,40 @@ public partial interface IGeminiClient /// /// /// + /// + /// 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> BatchesUpdateGenerateContentBatchAsResponseAsync( + string batchesId, + + global::Google.Gemini.GenerateContentBatch request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a batch of GenerateContent requests for batch processing. + /// + /// + /// /// /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. /// /// /// Configures the input to the batch request. /// - /// - /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. - /// - /// - /// Required. The user-defined name of this batch. - /// /// /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// /// /// Stats about the batch. /// + /// + /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. + /// + /// + /// Required. The user-defined name of this batch. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -51,10 +67,10 @@ public partial interface IGeminiClient string? updateMask = default, string? model = default, global::Google.Gemini.InputConfig? inputConfig = default, - global::Google.Gemini.GenerateContentBatchOutput? output = default, - string? displayName = default, string? priority = default, global::Google.Gemini.BatchStats? batchStats = default, + global::Google.Gemini.GenerateContentBatchOutput? output = default, + string? displayName = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsCreate.g.cs index ff6f03e24..376d62540 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsCreate.g.cs @@ -19,46 +19,58 @@ public partial interface IGeminiClient /// /// Creates CachedContent resource. /// - /// - /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. + /// + /// 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> CachedContentsCreateAsResponseAsync( + + global::Google.Gemini.CachedContent request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates CachedContent resource. + /// + /// + /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response + /// + /// + /// Input only. New TTL for this resource, input only. /// /// /// Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}` /// - /// - /// Optional. Input only. Immutable. The content to cache. + /// + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// /// /// The Tool configuration containing parameters for specifying `Tool` use in the request. /// - /// - /// Input only. New TTL for this resource, input only. + /// + /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. /// /// /// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. /// - /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. + /// + /// Optional. Input only. Immutable. The content to cache. /// /// /// Metadata on the usage of the cached content. /// - /// - /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next 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 CachedContentsCreateAsync( - string? expireTime = default, + global::System.Collections.Generic.IList? tools = default, + string? ttl = default, string? model = default, - global::System.Collections.Generic.IList? contents = default, + global::Google.Gemini.Content? systemInstruction = default, global::Google.Gemini.ToolConfig? toolConfig = default, - string? ttl = default, + string? expireTime = default, string? displayName = default, - global::Google.Gemini.Content? systemInstruction = default, + global::System.Collections.Generic.IList? contents = default, global::Google.Gemini.CachedContentUsageMetadata? usageMetadata = default, - global::System.Collections.Generic.IList? tools = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsDelete.g.cs index 4bfe0c9fb..901adf6d8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsDelete.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string cachedContentsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes CachedContent resource. + /// + /// + /// 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> CachedContentsDeleteAsResponseAsync( + string cachedContentsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsGet.g.cs index 9b5f46eab..8a6f912ac 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string cachedContentsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reads CachedContent resource. + /// + /// + /// 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> CachedContentsGetAsResponseAsync( + string cachedContentsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsList.g.cs index 4cdba1481..52941fe03 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsList.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists CachedContents. + /// + /// + /// + /// 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> CachedContentsListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsPatch.g.cs index 83a9b7a24..539530e53 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CachedContentsPatch.g.cs @@ -25,48 +25,64 @@ public partial interface IGeminiClient /// /// /// - /// - /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. + /// + /// 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> CachedContentsPatchAsResponseAsync( + string cachedContentsId, + + global::Google.Gemini.CachedContent request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates CachedContent resource (only expiration is updatable). + /// + /// + /// + /// + /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response + /// + /// + /// Input only. New TTL for this resource, input only. /// /// /// Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}` /// - /// - /// Optional. Input only. Immutable. The content to cache. + /// + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// /// /// The Tool configuration containing parameters for specifying `Tool` use in the request. /// - /// - /// Input only. New TTL for this resource, input only. + /// + /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. /// /// /// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. /// - /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. + /// + /// Optional. Input only. Immutable. The content to cache. /// /// /// Metadata on the usage of the cached content. /// - /// - /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next 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 CachedContentsPatchAsync( string cachedContentsId, string? updateMask = default, - string? expireTime = default, + global::System.Collections.Generic.IList? tools = default, + string? ttl = default, string? model = default, - global::System.Collections.Generic.IList? contents = default, + global::Google.Gemini.Content? systemInstruction = default, global::Google.Gemini.ToolConfig? toolConfig = default, - string? ttl = default, + string? expireTime = default, string? displayName = default, - global::Google.Gemini.Content? systemInstruction = default, + global::System.Collections.Generic.IList? contents = default, global::Google.Gemini.CachedContentUsageMetadata? usageMetadata = default, - global::System.Collections.Generic.IList? tools = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaCreate.g.cs index 08aaf5c6a..99eb61e9f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaCreate.g.cs @@ -19,6 +19,18 @@ public partial interface IGeminiClient /// /// Creates an empty `Corpus`. /// + /// + /// 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> CorporaCreateAsResponseAsync( + + global::Google.Gemini.Corpus request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates an empty `Corpus`. + /// /// /// Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaDelete.g.cs index fb98cd8df..c7d598230 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaDelete.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient bool? force = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes a `Corpus`. + /// + /// + /// + /// 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> CorporaDeleteAsResponseAsync( + string corporaId, + bool? force = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaGet.g.cs index 3b8dfec54..f1cf87b8a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaGet.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets information about a specific `Corpus`. + /// + /// + /// 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> CorporaGetAsResponseAsync( + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaList.g.cs index a1a2b5bd8..f82e8ac25 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaList.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists all `Corpora` owned by 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> CorporaListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaOperationsGet.g.cs index 35f8097c0..018c8bb7e 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaOperationsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> CorporaOperationsGetAsResponseAsync( + string operationsId, + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsCreate.g.cs index e6352a7d1..742c7e66a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsCreate.g.cs @@ -22,23 +22,37 @@ public partial interface IGeminiClient /// Create a permission to a specific resource. /// /// - /// - /// Required. The role granted by this permission. - /// + /// + /// 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> CorporaPermissionsCreateAsResponseAsync( + string corporaId, + + global::Google.Gemini.Permission request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a permission to a specific resource. + /// + /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// 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 CorporaPermissionsCreateAsync( string corporaId, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsDelete.g.cs index bb0315192..061621fbe 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsDelete.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes the permission. + /// + /// + /// + /// 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> CorporaPermissionsDeleteAsResponseAsync( + string permissionsId, + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsGet.g.cs index a25351c81..045236545 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string corporaId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets information about a specific Permission. + /// + /// + /// + /// 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> CorporaPermissionsGetAsResponseAsync( + string permissionsId, + string corporaId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsList.g.cs index 7ee05e3d8..edbf608ff 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsList.g.cs @@ -19,5 +19,20 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists permissions for the specific resource. + /// + /// + /// + /// + /// 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> CorporaPermissionsListAsResponseAsync( + string corporaId, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsPatch.g.cs index f49f85df7..b57a43d00 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.CorporaPermissionsPatch.g.cs @@ -28,15 +28,33 @@ public partial interface IGeminiClient /// /// /// - /// - /// Required. The role granted by this permission. - /// + /// + /// 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> CorporaPermissionsPatchAsResponseAsync( + string permissionsId, + string corporaId, + + global::Google.Gemini.Permission request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates the permission. + /// + /// + /// + /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -44,9 +62,9 @@ public partial interface IGeminiClient string permissionsId, string corporaId, string? updateMask = default, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicGenerateContent.g.cs index 53a13db37..5a8875a02 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicGenerateContent.g.cs @@ -22,51 +22,65 @@ public partial interface IGeminiClient /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// 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> DynamicGenerateContentAsResponseAsync( + string dynamicId, + + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + /// + /// + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 DynamicGenerateContentAsync( string dynamicId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContent.g.cs index f26d3860a..36b0aa743 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContent.g.cs @@ -22,51 +22,65 @@ public partial interface IGeminiClient /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// 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> DynamicStreamGenerateContentAsResponseAsync( + string dynamicId, + + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. + /// + /// + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 DynamicStreamGenerateContentAsync( string dynamicId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContentAsStream.g.cs index dd4dc1a1b..6db96a62d 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContentAsStream.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.DynamicStreamGenerateContentAsStream.g.cs @@ -22,51 +22,51 @@ public partial interface IGeminiClient /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 DynamicStreamGenerateContentAsStreamAsync( string dynamicId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresCreate.g.cs index 128c6434d..9edab07fb 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresCreate.g.cs @@ -19,6 +19,18 @@ public partial interface IGeminiClient /// /// Creates an empty `FileSearchStore`. /// + /// + /// 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> FileSearchStoresCreateAsResponseAsync( + + global::Google.Gemini.FileSearchStore request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates an empty `FileSearchStore`. + /// /// /// Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDelete.g.cs index 4c919a969..fc5ea6bfb 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDelete.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient bool? force = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes a `FileSearchStore`. + /// + /// + /// + /// 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> FileSearchStoresDeleteAsResponseAsync( + string fileSearchStoresId, + bool? force = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsDelete.g.cs index 6479ce8e5..4b82bd9b7 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsDelete.g.cs @@ -19,5 +19,20 @@ public partial interface IGeminiClient bool? force = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes a `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> FileSearchStoresDocumentsDeleteAsResponseAsync( + string fileSearchStoresId, + string documentsId, + bool? force = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsGet.g.cs index 5775bc0a2..372c86454 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string documentsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets information about a specific `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> FileSearchStoresDocumentsGetAsResponseAsync( + string fileSearchStoresId, + string documentsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsList.g.cs index caa107bf4..1a0a0c670 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresDocumentsList.g.cs @@ -19,5 +19,20 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists all `Document`s in a `Corpus`. + /// + /// + /// + /// + /// 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> FileSearchStoresDocumentsListAsResponseAsync( + string fileSearchStoresId, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresGet.g.cs index 699557337..b960badb7 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresGet.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string fileSearchStoresId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets information about a specific `FileSearchStore`. + /// + /// + /// 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> FileSearchStoresGetAsResponseAsync( + string fileSearchStoresId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresImportFile.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresImportFile.g.cs index 5a2b2d7d9..95c834be9 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresImportFile.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresImportFile.g.cs @@ -22,23 +22,37 @@ public partial interface IGeminiClient /// Imports a `File` from File Service to a `FileSearchStore`. /// /// - /// - /// Custom metadata to be associated with the 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> FileSearchStoresImportFileAsResponseAsync( + string fileSearchStoresId, + + global::Google.Gemini.ImportFileRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Imports a `File` from File Service to a `FileSearchStore`. + /// + /// + /// + /// Required. The name of the `File` to import. Example: `files/abc-123` /// /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto /// - /// - /// Required. The name of the `File` to import. Example: `files/abc-123` + /// + /// Custom metadata to be associated with the 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 FileSearchStoresImportFileAsync( string fileSearchStoresId, - global::System.Collections.Generic.IList? customMetadata = default, - global::Google.Gemini.ChunkingConfig? chunkingConfig = default, string? fileName = default, + global::Google.Gemini.ChunkingConfig? chunkingConfig = default, + global::System.Collections.Generic.IList? customMetadata = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresList.g.cs index 30f99848b..602e2085a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresList.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists all `FileSearchStores` owned by 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> FileSearchStoresListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresOperationsGet.g.cs index e6c40b673..9b16ae0c4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresOperationsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string fileSearchStoresId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> FileSearchStoresOperationsGetAsResponseAsync( + string operationsId, + string fileSearchStoresId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresUploadOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresUploadOperationsGet.g.cs index 9af1355c1..43905ae3a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresUploadOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FileSearchStoresUploadOperationsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string fileSearchStoresId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> FileSearchStoresUploadOperationsGetAsResponseAsync( + string operationsId, + string fileSearchStoresId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesDelete.g.cs index 7c91a3b25..d359862ff 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesDelete.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string filesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes the `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> FilesDeleteAsResponseAsync( + string filesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesGet.g.cs index d73c9ea2d..d344e0e63 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesGet.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string filesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the metadata for the given `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> FilesGetAsResponseAsync( + string filesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesList.g.cs index 259e3cf8b..ef9dbdf15 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesList.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists the metadata for `File`s owned by the requesting project. + /// + /// + /// + /// 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> FilesListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesRegister.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesRegister.g.cs index ffbe76bda..f0586ab5a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesRegister.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.FilesRegister.g.cs @@ -19,6 +19,18 @@ public partial interface IGeminiClient /// /// Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails. /// + /// + /// 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> FilesRegisterAsResponseAsync( + + global::Google.Gemini.RegisterFilesRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails. + /// /// /// Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesList.g.cs index dfefcbf6e..54f7a929f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesList.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists the generated files owned by the requesting project. + /// + /// + /// + /// 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> GeneratedFilesListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesOperationsGet.g.cs index 1e3c66b3d..254ad001c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.GeneratedFilesOperationsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string generatedFilesId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> GeneratedFilesOperationsGetAsResponseAsync( + string operationsId, + string generatedFilesId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUpload.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUpload.g.cs index 0818d6f07..2f403710c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUpload.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUpload.g.cs @@ -19,6 +19,18 @@ public partial interface IGeminiClient /// /// Creates 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> MediaUploadAsResponseAsync( + + global::Google.Gemini.CreateFileRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates a `File`. + /// /// /// A file uploaded to the API. Next ID: 15 /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUploadToFileSearchStore.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUploadToFileSearchStore.g.cs index 5c70fce1e..7a2345e1b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUploadToFileSearchStore.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.MediaUploadToFileSearchStore.g.cs @@ -22,15 +22,29 @@ public partial interface IGeminiClient /// Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document. /// /// - /// - /// Custom metadata to be associated with the data. - /// + /// + /// 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> MediaUploadToFileSearchStoreAsResponseAsync( + string fileSearchStoresId, + + global::Google.Gemini.UploadToFileSearchStoreRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document. + /// + /// /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto /// /// /// Optional. Display name of the created document. /// + /// + /// Custom metadata to be associated with the data. + /// /// /// Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content. /// @@ -39,9 +53,9 @@ public partial interface IGeminiClient /// global::System.Threading.Tasks.Task MediaUploadToFileSearchStoreAsync( string fileSearchStoresId, - global::System.Collections.Generic.IList? customMetadata = default, global::Google.Gemini.ChunkingConfig? chunkingConfig = default, string? displayName = default, + global::System.Collections.Generic.IList? customMetadata = default, string? mimeType = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsAsyncBatchEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsAsyncBatchEmbedContent.g.cs index 6e822bdbc..71fbd7651 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsAsyncBatchEmbedContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsAsyncBatchEmbedContent.g.cs @@ -22,6 +22,20 @@ public partial interface IGeminiClient /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion. /// /// + /// + /// 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> ModelsAsyncBatchEmbedContentAsResponseAsync( + string modelsId, + + global::Google.Gemini.AsyncBatchEmbedContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion. + /// + /// /// /// A resource representing a batch of `EmbedContent` requests. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchEmbedContents.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchEmbedContents.g.cs index 526d9e76a..033ad2f23 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchEmbedContents.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchEmbedContents.g.cs @@ -22,6 +22,20 @@ public partial interface IGeminiClient /// Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects. /// /// + /// + /// 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> ModelsBatchEmbedContentsAsResponseAsync( + string modelsId, + + global::Google.Gemini.BatchEmbedContentsRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects. + /// + /// /// /// Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchGenerateContent.g.cs index a1091b8bc..c933942d2 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsBatchGenerateContent.g.cs @@ -22,6 +22,20 @@ public partial interface IGeminiClient /// Enqueues a batch of `GenerateContent` requests for batch 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> ModelsBatchGenerateContentAsResponseAsync( + string modelsId, + + global::Google.Gemini.BatchGenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enqueues a batch of `GenerateContent` requests for batch processing. + /// + /// /// /// A resource representing a batch of `GenerateContent` requests. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsCountTokens.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsCountTokens.g.cs index 3de073d14..a6d6ed6c6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsCountTokens.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsCountTokens.g.cs @@ -22,6 +22,20 @@ public partial interface IGeminiClient /// Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens. /// /// + /// + /// 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> ModelsCountTokensAsResponseAsync( + string modelsId, + + global::Google.Gemini.CountTokensRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens. + /// + /// /// /// Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsEmbedContent.g.cs index ef3060090..93f07c6e4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsEmbedContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsEmbedContent.g.cs @@ -24,6 +24,20 @@ public partial interface IGeminiClient /// Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). /// /// + /// + /// 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> ModelsEmbedContentAsResponseAsync( + string modelsId, + + global::Google.Gemini.EmbedContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). + /// + /// /// /// Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}` /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGenerateContent.g.cs index 5e21c2893..bd3959ba4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGenerateContent.g.cs @@ -22,51 +22,65 @@ public partial interface IGeminiClient /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// 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> ModelsGenerateContentAsResponseAsync( + string modelsId, + + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + /// + /// + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 ModelsGenerateContentAsync( string modelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGet.g.cs index 91ba629f5..367113bfe 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string modelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information. + /// + /// + /// 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> ModelsGetAsResponseAsync( + string modelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsList.g.cs index 52865ed8a..3cc13d8d6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsList.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API. + /// + /// + /// + /// 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> ModelsListAsResponseAsync( + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsGet.g.cs index c83e0ae1d..af620022f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string modelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> ModelsOperationsGetAsResponseAsync( + string operationsId, + string modelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsList.g.cs index 55dfb94bf..1a67f295c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsOperationsList.g.cs @@ -23,5 +23,24 @@ public partial interface IGeminiClient bool? returnPartialSuccess = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// + /// + /// + /// + /// + /// 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> ModelsOperationsListAsResponseAsync( + string modelsId, + string? filter = default, + int? pageSize = default, + string? pageToken = default, + bool? returnPartialSuccess = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContent.g.cs index c57c8fb35..96ff1005c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContent.g.cs @@ -22,51 +22,65 @@ public partial interface IGeminiClient /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// 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> ModelsStreamGenerateContentAsResponseAsync( + string modelsId, + + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. + /// + /// + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 ModelsStreamGenerateContentAsync( string modelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContentAsStream.g.cs index 5bce73191..0459d6801 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContentAsStream.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.ModelsStreamGenerateContentAsStream.g.cs @@ -22,51 +22,51 @@ public partial interface IGeminiClient /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 ModelsStreamGenerateContentAsStreamAsync( string modelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs index f3b192cc1..4ad6dfa01 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs @@ -22,6 +22,20 @@ public partial interface IGeminiClient /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion. /// /// + /// + /// 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> TunedModelsAsyncBatchEmbedContentAsResponseAsync( + string tunedModelsId, + + global::Google.Gemini.AsyncBatchEmbedContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion. + /// + /// /// /// A resource representing a batch of `EmbedContent` requests. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsBatchGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsBatchGenerateContent.g.cs index cb1786c98..0999ecc50 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsBatchGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsBatchGenerateContent.g.cs @@ -22,6 +22,20 @@ public partial interface IGeminiClient /// Enqueues a batch of `GenerateContent` requests for batch 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> TunedModelsBatchGenerateContentAsResponseAsync( + string tunedModelsId, + + global::Google.Gemini.BatchGenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enqueues a batch of `GenerateContent` requests for batch processing. + /// + /// /// /// A resource representing a batch of `GenerateContent` requests. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsCreate.g.cs index 86f236a6b..6323e7a3a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsCreate.g.cs @@ -22,47 +22,61 @@ public partial interface IGeminiClient /// Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 /// /// - /// - /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - /// - /// - /// Optional. List of project numbers that have read access to the 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> TunedModelsCreateAsResponseAsync( + + global::Google.Gemini.TunedModel request, + string? tunedModelId = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 + /// + /// /// /// Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. - /// - /// - /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. + /// + /// Optional. A short description of this model. /// /// /// Tuning tasks that create tuned models. /// + /// + /// Tuned model as a source for training a new model. + /// + /// + /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// /// /// Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` /// - /// - /// Optional. A short description of this model. + /// + /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Tuned model as a source for training a new model. + /// + /// Optional. List of project numbers that have read access to the tuned model. + /// + /// + /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. /// /// 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 TunedModelsCreateAsync( string? tunedModelId = default, - string? displayName = default, - global::System.Collections.Generic.IList? readerProjectNumbers = default, float? topP = default, - int? topK = default, - float? temperature = default, - global::Google.Gemini.TuningTask? tuningTask = default, - string? baseModel = default, string? description = default, + global::Google.Gemini.TuningTask? tuningTask = default, global::Google.Gemini.TunedModelSource? tunedModelSource = default, + int? topK = default, + string? baseModel = default, + float? temperature = default, + global::System.Collections.Generic.IList? readerProjectNumbers = default, + string? displayName = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsDelete.g.cs index 2ce1d72e1..0a76f198f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsDelete.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string tunedModelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes a 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> TunedModelsDeleteAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGenerateContent.g.cs index 6d11b6598..f673fd740 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGenerateContent.g.cs @@ -22,51 +22,65 @@ public partial interface IGeminiClient /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// 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> TunedModelsGenerateContentAsResponseAsync( + string tunedModelsId, + + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + /// + /// + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 TunedModelsGenerateContentAsync( string tunedModelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGet.g.cs index 1e8a5170a..32db40544 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IGeminiClient string tunedModelsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets information about a specific TunedModel. + /// + /// + /// 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> TunedModelsGetAsResponseAsync( + string tunedModelsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsList.g.cs index 9eabbf02a..ca41a7af7 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsList.g.cs @@ -19,5 +19,20 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists created tuned models. + /// + /// + /// + /// + /// 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> TunedModelsListAsResponseAsync( + string? filter = default, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsGet.g.cs index 50d9c4fdb..981d05619 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string operationsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// + /// + /// 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> TunedModelsOperationsGetAsResponseAsync( + string tunedModelsId, + string operationsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsList.g.cs index 79f2a144e..bd75ef060 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsOperationsList.g.cs @@ -23,5 +23,24 @@ public partial interface IGeminiClient bool? returnPartialSuccess = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// + /// + /// + /// + /// + /// 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> TunedModelsOperationsListAsResponseAsync( + string tunedModelsId, + string? filter = default, + int? pageSize = default, + string? pageToken = default, + bool? returnPartialSuccess = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPatch.g.cs index b68bc5e30..62537b057 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPatch.g.cs @@ -25,32 +25,48 @@ public partial interface IGeminiClient /// /// /// - /// - /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - /// - /// - /// Optional. List of project numbers that have read access to the 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> TunedModelsPatchAsResponseAsync( + string tunedModelsId, + + global::Google.Gemini.TunedModel request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a tuned model. + /// + /// + /// /// /// Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. - /// - /// - /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. + /// + /// Optional. A short description of this model. /// /// /// Tuning tasks that create tuned models. /// + /// + /// Tuned model as a source for training a new model. + /// + /// + /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// /// /// Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` /// - /// - /// Optional. A short description of this model. + /// + /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Tuned model as a source for training a new model. + /// + /// Optional. List of project numbers that have read access to the tuned model. + /// + /// + /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -58,15 +74,15 @@ public partial interface IGeminiClient global::System.Threading.Tasks.Task TunedModelsPatchAsync( string tunedModelsId, string? updateMask = default, - string? displayName = default, - global::System.Collections.Generic.IList? readerProjectNumbers = default, float? topP = default, - int? topK = default, - float? temperature = default, - global::Google.Gemini.TuningTask? tuningTask = default, - string? baseModel = default, string? description = default, + global::Google.Gemini.TuningTask? tuningTask = default, global::Google.Gemini.TunedModelSource? tunedModelSource = default, + int? topK = default, + string? baseModel = default, + float? temperature = default, + global::System.Collections.Generic.IList? readerProjectNumbers = default, + string? displayName = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsCreate.g.cs index 0b0f721be..6d247e33f 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsCreate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsCreate.g.cs @@ -22,23 +22,37 @@ public partial interface IGeminiClient /// Create a permission to a specific resource. /// /// - /// - /// Required. The role granted by this permission. - /// + /// + /// 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> TunedModelsPermissionsCreateAsResponseAsync( + string tunedModelsId, + + global::Google.Gemini.Permission request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a permission to a specific resource. + /// + /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// 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 TunedModelsPermissionsCreateAsync( string tunedModelsId, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsDelete.g.cs index 5178f5fea..d0a9f6a21 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsDelete.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsDelete.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string permissionsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes the permission. + /// + /// + /// + /// 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> TunedModelsPermissionsDeleteAsResponseAsync( + string tunedModelsId, + string permissionsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsGet.g.cs index 2d5656665..ccec929d9 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsGet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsGet.g.cs @@ -17,5 +17,18 @@ public partial interface IGeminiClient string permissionsId, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets information about a specific Permission. + /// + /// + /// + /// 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> TunedModelsPermissionsGetAsResponseAsync( + string tunedModelsId, + string permissionsId, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsList.g.cs index 0e29566a1..b4d6d8ec8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsList.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsList.g.cs @@ -19,5 +19,20 @@ public partial interface IGeminiClient string? pageToken = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists permissions for the specific resource. + /// + /// + /// + /// + /// 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> TunedModelsPermissionsListAsResponseAsync( + string tunedModelsId, + int? pageSize = default, + string? pageToken = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsPatch.g.cs index 7becdff78..065efa6e8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsPatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsPermissionsPatch.g.cs @@ -28,15 +28,33 @@ public partial interface IGeminiClient /// /// /// - /// - /// Required. The role granted by this permission. - /// + /// + /// 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> TunedModelsPermissionsPatchAsResponseAsync( + string tunedModelsId, + string permissionsId, + + global::Google.Gemini.Permission request, + string? updateMask = default, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates the permission. + /// + /// + /// + /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -44,9 +62,9 @@ public partial interface IGeminiClient string tunedModelsId, string permissionsId, string? updateMask = default, - global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.PermissionGranteeType? granteeType = default, string? emailAddress = default, + global::Google.Gemini.PermissionRole? role = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContent.g.cs index 12cecf8c7..f7cb58c53 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContent.g.cs @@ -22,51 +22,65 @@ public partial interface IGeminiClient /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// 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> TunedModelsStreamGenerateContentAsResponseAsync( + string tunedModelsId, + + global::Google.Gemini.GenerateContentRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. + /// + /// + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 TunedModelsStreamGenerateContentAsync( string tunedModelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs index 2d0cea159..ad0720286 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsStreamGenerateContentAsStream.g.cs @@ -22,51 +22,51 @@ public partial interface IGeminiClient /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`. /// /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// /// 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 TunedModelsStreamGenerateContentAsStreamAsync( string tunedModelsId, - global::System.Collections.Generic.IList? contents = default, - global::Google.Gemini.ToolConfig? toolConfig = default, - string? model = default, + global::Google.Gemini.GenerationConfig? generationConfig = default, + global::System.Collections.Generic.IList? tools = default, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, global::Google.Gemini.Content? systemInstruction = default, + global::Google.Gemini.ToolConfig? toolConfig = default, string? cachedContent = default, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? safetySettings = default, - global::Google.Gemini.GenerationConfig? generationConfig = default, bool? store = default, + string? model = default, + global::System.Collections.Generic.IList? contents = default, + global::System.Collections.Generic.IList? safetySettings = default, global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsTransferOwnership.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsTransferOwnership.g.cs index fb3a53402..cb31ac8a8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsTransferOwnership.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.IGeminiClient.TunedModelsTransferOwnership.g.cs @@ -22,6 +22,20 @@ public partial interface IGeminiClient /// Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role. /// /// + /// + /// 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> TunedModelsTransferOwnershipAsResponseAsync( + string tunedModelsId, + + global::Google.Gemini.TransferOwnershipRequest request, + global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role. + /// + /// /// /// Required. The email address of the user to whom the tuned model is being transferred to. /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContext.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContext.g.cs index d96fbe5be..01e7aefb9 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContext.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContext.g.cs @@ -13,425 +13,425 @@ namespace Google.Gemini DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { - typeof(global::Google.Gemini.JsonConverters.SafetyRatingCategoryJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FunctionCallingConfigModeJsonConverter), - typeof(global::Google.Gemini.JsonConverters.SafetyRatingCategoryNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FunctionCallingConfigModeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.SafetyRatingProbabilityJsonConverter), + typeof(global::Google.Gemini.JsonConverters.UrlMetadataUrlRetrievalStatusJsonConverter), - typeof(global::Google.Gemini.JsonConverters.SafetyRatingProbabilityNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.UrlMetadataUrlRetrievalStatusNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.PromptFeedbackBlockReasonJsonConverter), + typeof(global::Google.Gemini.JsonConverters.EmbedContentConfigTaskTypeJsonConverter), - typeof(global::Google.Gemini.JsonConverters.PromptFeedbackBlockReasonNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.EmbedContentConfigTaskTypeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.EmbedContentRequestTaskTypeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.TunedModelStateJsonConverter), - typeof(global::Google.Gemini.JsonConverters.EmbedContentRequestTaskTypeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.TunedModelStateNullableJsonConverter), typeof(global::Google.Gemini.JsonConverters.GenerateContentRequestServiceTierJsonConverter), typeof(global::Google.Gemini.JsonConverters.GenerateContentRequestServiceTierNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.SchemaTypeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GenerateContentBatchStateJsonConverter), - typeof(global::Google.Gemini.JsonConverters.SchemaTypeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GenerateContentBatchStateNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.PermissionRoleJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FileSourceJsonConverter), - typeof(global::Google.Gemini.JsonConverters.PermissionRoleNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FileSourceNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.PermissionGranteeTypeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FileStateJsonConverter), - typeof(global::Google.Gemini.JsonConverters.PermissionGranteeTypeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FileStateNullableJsonConverter), + + typeof(global::Google.Gemini.JsonConverters.PromptFeedbackBlockReasonJsonConverter), + + typeof(global::Google.Gemini.JsonConverters.PromptFeedbackBlockReasonNullableJsonConverter), typeof(global::Google.Gemini.JsonConverters.DocumentStateJsonConverter), typeof(global::Google.Gemini.JsonConverters.DocumentStateNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.EmbedContentConfigTaskTypeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FunctionDeclarationBehaviorJsonConverter), - typeof(global::Google.Gemini.JsonConverters.EmbedContentConfigTaskTypeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FunctionDeclarationBehaviorNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ModelStatusModelStageJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ExecutableCodeLanguageJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ModelStatusModelStageNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ExecutableCodeLanguageNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FunctionDeclarationBehaviorJsonConverter), + typeof(global::Google.Gemini.JsonConverters.PermissionGranteeTypeJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FunctionDeclarationBehaviorNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.PermissionGranteeTypeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ThinkingConfigThinkingLevelJsonConverter), + typeof(global::Google.Gemini.JsonConverters.PermissionRoleJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ThinkingConfigThinkingLevelNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.PermissionRoleNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.EmbedContentBatchStateJsonConverter), + typeof(global::Google.Gemini.JsonConverters.SafetyRatingProbabilityJsonConverter), - typeof(global::Google.Gemini.JsonConverters.EmbedContentBatchStateNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.SafetyRatingProbabilityNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FileSourceJsonConverter), + typeof(global::Google.Gemini.JsonConverters.SafetyRatingCategoryJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FileSourceNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.SafetyRatingCategoryNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FileStateJsonConverter), + typeof(global::Google.Gemini.JsonConverters.SafetySettingCategoryJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FileStateNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.SafetySettingCategoryNullableJsonConverter), + + typeof(global::Google.Gemini.JsonConverters.SafetySettingThresholdJsonConverter), + + typeof(global::Google.Gemini.JsonConverters.SafetySettingThresholdNullableJsonConverter), + + typeof(global::Google.Gemini.JsonConverters.SchemaTypeJsonConverter), + + typeof(global::Google.Gemini.JsonConverters.SchemaTypeNullableJsonConverter), typeof(global::Google.Gemini.JsonConverters.ComputerUseEnvironmentJsonConverter), typeof(global::Google.Gemini.JsonConverters.ComputerUseEnvironmentNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.UrlMetadataUrlRetrievalStatusJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ThinkingConfigThinkingLevelJsonConverter), - typeof(global::Google.Gemini.JsonConverters.UrlMetadataUrlRetrievalStatusNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ThinkingConfigThinkingLevelNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FunctionResponseSchedulingJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GenerationConfigResponseModalitieJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FunctionResponseSchedulingNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GenerationConfigResponseModalitieNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ToolCallToolTypeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GenerationConfigMediaResolutionJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ToolCallToolTypeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GenerationConfigMediaResolutionNullableJsonConverter), typeof(global::Google.Gemini.JsonConverters.CandidateFinishReasonJsonConverter), typeof(global::Google.Gemini.JsonConverters.CandidateFinishReasonNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.SafetySettingCategoryJsonConverter), - - typeof(global::Google.Gemini.JsonConverters.SafetySettingCategoryNullableJsonConverter), - - typeof(global::Google.Gemini.JsonConverters.SafetySettingThresholdJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FunctionResponseSchedulingJsonConverter), - typeof(global::Google.Gemini.JsonConverters.SafetySettingThresholdNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.FunctionResponseSchedulingNullableJsonConverter), typeof(global::Google.Gemini.JsonConverters.ToolResponseToolTypeJsonConverter), typeof(global::Google.Gemini.JsonConverters.ToolResponseToolTypeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.GenerateContentBatchStateJsonConverter), - - typeof(global::Google.Gemini.JsonConverters.GenerateContentBatchStateNullableJsonConverter), - - typeof(global::Google.Gemini.JsonConverters.GeneratedFileStateJsonConverter), - - typeof(global::Google.Gemini.JsonConverters.GeneratedFileStateNullableJsonConverter), - - typeof(global::Google.Gemini.JsonConverters.DynamicRetrievalConfigModeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ModalityTokenCountModalityJsonConverter), - typeof(global::Google.Gemini.JsonConverters.DynamicRetrievalConfigModeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ModalityTokenCountModalityNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FunctionCallingConfigModeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.CodeExecutionResultOutcomeJsonConverter), - typeof(global::Google.Gemini.JsonConverters.FunctionCallingConfigModeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.CodeExecutionResultOutcomeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.GenerationConfigMediaResolutionJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ToolCallToolTypeJsonConverter), - typeof(global::Google.Gemini.JsonConverters.GenerationConfigMediaResolutionNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ToolCallToolTypeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.GenerationConfigResponseModalitieJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GeneratedFileStateJsonConverter), - typeof(global::Google.Gemini.JsonConverters.GenerationConfigResponseModalitieNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.GeneratedFileStateNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.TunedModelStateJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ModelStatusModelStageJsonConverter), - typeof(global::Google.Gemini.JsonConverters.TunedModelStateNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.ModelStatusModelStageNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ExecutableCodeLanguageJsonConverter), + typeof(global::Google.Gemini.JsonConverters.DynamicRetrievalConfigModeJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ExecutableCodeLanguageNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.DynamicRetrievalConfigModeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ModalityTokenCountModalityJsonConverter), + typeof(global::Google.Gemini.JsonConverters.EmbedContentRequestTaskTypeJsonConverter), - typeof(global::Google.Gemini.JsonConverters.ModalityTokenCountModalityNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.EmbedContentRequestTaskTypeNullableJsonConverter), - typeof(global::Google.Gemini.JsonConverters.CodeExecutionResultOutcomeJsonConverter), + typeof(global::Google.Gemini.JsonConverters.EmbedContentBatchStateJsonConverter), - typeof(global::Google.Gemini.JsonConverters.CodeExecutionResultOutcomeNullableJsonConverter), + typeof(global::Google.Gemini.JsonConverters.EmbedContentBatchStateNullableJsonConverter), typeof(global::Google.Gemini.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.JsonSerializerContextTypes))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleSearch))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Interval))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SearchTypes))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListOperationsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Operation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionCallingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionCallingConfigMode), TypeInfoPropertyName = "FunctionCallingConfigMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetyRating))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetyRatingCategory), TypeInfoPropertyName = "SafetyRatingCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetyRatingProbability), TypeInfoPropertyName = "SafetyRatingProbability2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UsageMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModalityTokenCount))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchGenerateContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentBatch))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CreateFileResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.File))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ChunkingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.WhiteSpaceConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ImageSearch))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CountTokensResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UrlMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UrlMetadataUrlRetrievalStatus), TypeInfoPropertyName = "UrlMetadataUrlRetrievalStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SearchEntryPoint))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RetrievalConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.LatLng))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Corpus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PromptFeedback))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PromptFeedbackBlockReason), TypeInfoPropertyName = "PromptFeedbackBlockReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TunedModelSource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingChunk))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Web))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Image))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RetrievedContext))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Maps))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CustomMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.StringList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SpeechConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.MultiSpeakerVoiceConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.VoiceConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentRequestTaskType), TypeInfoPropertyName = "EmbedContentRequestTaskType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Content))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentConfigTaskType), TypeInfoPropertyName = "EmbedContentConfigTaskType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponsePart))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponseBlob))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TunedModel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TuningTask))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TunedModelSource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TunedModelState), TypeInfoPropertyName = "TunedModelState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentResponses))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Interval))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentRequestServiceTier), TypeInfoPropertyName = "GenerateContentRequestServiceTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerationConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Tool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentRequestServiceTier), TypeInfoPropertyName = "GenerateContentRequestServiceTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Content))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetySetting))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerationConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Empty))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Schema))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SchemaType), TypeInfoPropertyName = "SchemaType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Permission))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PermissionRole), TypeInfoPropertyName = "PermissionRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PermissionGranteeType), TypeInfoPropertyName = "PermissionGranteeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TransferOwnershipResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SpeakerVoiceConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingChunkCustomMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingChunkStringList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListCorporaResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Corpus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentBatch))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InputConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentBatchState), TypeInfoPropertyName = "GenerateContentBatchState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchStats))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentBatchOutput))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TopCandidates))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.LogprobsResultCandidate))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Document))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CustomMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.DocumentState), TypeInfoPropertyName = "DocumentState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentConfigTaskType), TypeInfoPropertyName = "EmbedContentConfigTaskType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ReviewSnippet))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileSearchStore))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListPermissionsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleSearchRetrieval))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.DynamicRetrievalConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PrebuiltVoiceConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PlaceAnswerSources))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModelStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModelStatusModelStage), TypeInfoPropertyName = "ModelStatusModelStage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListDocumentsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ImportFileRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionDeclaration))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionDeclarationBehavior), TypeInfoPropertyName = "FunctionDeclarationBehavior2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ThinkingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ThinkingConfigThinkingLevel), TypeInfoPropertyName = "ThinkingConfigThinkingLevel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CountTokensRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentResponses))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchEmbedContentsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ContentEmbedding))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbeddingUsageMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.VideoFileMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TransferOwnershipRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatch))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatchState), TypeInfoPropertyName = "EmbedContentBatchState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InputEmbedContentConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatchOutput))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatchStats))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedResponses))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RetrievedContext))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingChunkCustomMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedRequests))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.StringList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CitationMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CitationSource))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingChunkStringList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Dataset))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TuningExamples))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingPassageId))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TuningExample))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PromptFeedback))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Candidate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UsageMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModelStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PlaceAnswerSources))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchEmbedContentsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InputEmbedContentConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentRequests))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.File))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Status))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileSource), TypeInfoPropertyName = "FileSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileState), TypeInfoPropertyName = "FileState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.VideoFileMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TransferOwnershipRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PrebuiltVoiceConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ChunkingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.WhiteSpaceConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatchOutput))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListGeneratedFilesResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GeneratedFile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Blob))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SearchEntryPoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.LogprobsResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ImageConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleAiGenerativelanguageV1betaSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListFilesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModalityTokenCount))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListFileSearchStoresResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileSource), TypeInfoPropertyName = "FileSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileState), TypeInfoPropertyName = "FileState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Status))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentBatchOutput))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileSearchStore))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchEmbedContentsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TuningSnapshot))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SemanticRetrieverChunk))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleAiGenerativelanguageV1betaGroundingSupport))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RetrievalMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Part))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedRequests))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Model))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CodeExecution))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileSearch))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleSearchRetrieval))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.DynamicRetrievalConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PromptFeedbackBlockReason), TypeInfoPropertyName = "PromptFeedbackBlockReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetyRating))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Dataset))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.WebSearch))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Document))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.DocumentState), TypeInfoPropertyName = "DocumentState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingAttribution))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.AttributionSourceId))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponsePart))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponseBlob))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CustomLongRunningOperation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionDeclaration))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Schema))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionDeclarationBehavior), TypeInfoPropertyName = "FunctionDeclarationBehavior2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ExecutableCode))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ExecutableCodeLanguage), TypeInfoPropertyName = "ExecutableCodeLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListTunedModelsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Operation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionCall))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TransferOwnershipResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Permission))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PermissionGranteeType), TypeInfoPropertyName = "PermissionGranteeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.PermissionRole), TypeInfoPropertyName = "PermissionRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetyRatingProbability), TypeInfoPropertyName = "SafetyRatingProbability2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetyRatingCategory), TypeInfoPropertyName = "SafetyRatingCategory2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetySettingCategory), TypeInfoPropertyName = "SafetySettingCategory2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetySettingThreshold), TypeInfoPropertyName = "SafetySettingThreshold2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleMaps))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SchemaType), TypeInfoPropertyName = "SchemaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RegisterFilesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ComputerUse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ComputerUseEnvironment), TypeInfoPropertyName = "ComputerUseEnvironment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileSearch))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InputConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UrlContextMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UrlMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListCachedContentsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CachedContent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Hyperparameters))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Web))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Image))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Maps))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CachedContentUsageMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TuningExample))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleMaps))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UrlMetadataUrlRetrievalStatus), TypeInfoPropertyName = "UrlMetadataUrlRetrievalStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Part))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponseScheduling), TypeInfoPropertyName = "FunctionResponseScheduling2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Model))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.StreamableHttpTransport))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RetrievalMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolCall))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolCallToolType), TypeInfoPropertyName = "ToolCallToolType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.McpServer))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingPassageId))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SearchTypes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ImageSearch))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.VideoMetadata))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListModelsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TuningSnapshot))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RegisterFilesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CodeExecution))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CountTokensResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UploadToFileSearchStoreRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CreateFileRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleAiGenerativelanguageV1betaGroundingSupport))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Candidate))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CandidateFinishReason), TypeInfoPropertyName = "CandidateFinishReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GroundingMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ThinkingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ThinkingConfigThinkingLevel), TypeInfoPropertyName = "ThinkingConfigThinkingLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ImageConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerationConfigResponseModalitie), TypeInfoPropertyName = "GenerationConfigResponseModalitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerationConfigMediaResolution), TypeInfoPropertyName = "GenerationConfigMediaResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Blob))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UrlContextMetadata))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetySettingCategory), TypeInfoPropertyName = "SafetySettingCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SafetySettingThreshold), TypeInfoPropertyName = "SafetySettingThreshold2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolResponseToolType), TypeInfoPropertyName = "ToolResponseToolType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerateContentBatchState), TypeInfoPropertyName = "GenerateContentBatchState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchStats))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.AsyncBatchEmbedContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.WebSearch))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CustomLongRunningOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionCall))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.VideoMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ExecutableCode))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CodeExecutionResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GeneratedFileState), TypeInfoPropertyName = "GeneratedFileState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.DynamicRetrievalConfigMode), TypeInfoPropertyName = "DynamicRetrievalConfigMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CandidateFinishReason), TypeInfoPropertyName = "CandidateFinishReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CitationMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.LogprobsResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListPermissionsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleSearch))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.McpServer))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.UrlContext))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionCallingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionCallingConfigMode), TypeInfoPropertyName = "FunctionCallingConfigMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerationConfigMediaResolution), TypeInfoPropertyName = "GenerationConfigMediaResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GenerationConfigResponseModalitie), TypeInfoPropertyName = "GenerationConfigResponseModalitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TunedModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TunedModelState), TypeInfoPropertyName = "TunedModelState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.TuningTask))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SpeakerVoiceConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ExecutableCodeLanguage), TypeInfoPropertyName = "ExecutableCodeLanguage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.SemanticRetrieverChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedEmbedContentRequests))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModalityTokenCountModality), TypeInfoPropertyName = "ModalityTokenCountModality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ReviewSnippet))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FunctionResponseScheduling), TypeInfoPropertyName = "FunctionResponseScheduling2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CodeExecutionResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolCall))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.FileData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolResponseToolType), TypeInfoPropertyName = "ToolResponseToolType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.RegisterFilesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListCorporaResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GoogleAiGenerativelanguageV1betaSegment))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Empty))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.StreamableHttpTransport))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModalityTokenCountModality), TypeInfoPropertyName = "ModalityTokenCountModality2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CodeExecutionResultOutcome), TypeInfoPropertyName = "CodeExecutionResultOutcome2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchEmbedContentsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListCachedContentsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CachedContent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ToolCallToolType), TypeInfoPropertyName = "ToolCallToolType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.BatchGenerateContentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListDocumentsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.InlinedResponses))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CreateFileRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.GeneratedFileState), TypeInfoPropertyName = "GeneratedFileState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CreateFileResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.AsyncBatchEmbedContentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatch))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ModelStatusModelStage), TypeInfoPropertyName = "ModelStatusModelStage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.CitationSource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListOperationsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListTunedModelsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.Hyperparameters))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ImportFileRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.DynamicRetrievalConfigMode), TypeInfoPropertyName = "DynamicRetrievalConfigMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatchStats))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.ListFilesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentRequestTaskType), TypeInfoPropertyName = "EmbedContentRequestTaskType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Google.Gemini.EmbedContentBatchState), TypeInfoPropertyName = "EmbedContentBatchState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContextTypes.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContextTypes.g.cs index b074240f2..075a1cc2e 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContextTypes.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.JsonSerializerContextTypes.g.cs @@ -28,123 +28,123 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Google.Gemini.GoogleSearch? Type0 { get; set; } + public global::Google.Gemini.FunctionCallingConfig? Type0 { get; set; } /// /// /// - public global::Google.Gemini.Interval? Type1 { get; set; } + public global::Google.Gemini.FunctionCallingConfigMode? Type1 { get; set; } /// /// /// - public global::Google.Gemini.SearchTypes? Type2 { get; set; } + public global::System.Collections.Generic.IList? Type2 { get; set; } /// /// /// - public global::Google.Gemini.ListOperationsResponse? Type3 { get; set; } + public string? Type3 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type4 { get; set; } + public global::Google.Gemini.UrlMetadata? Type4 { get; set; } /// /// /// - public global::Google.Gemini.Operation? Type5 { get; set; } + public global::Google.Gemini.UrlMetadataUrlRetrievalStatus? Type5 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type6 { get; set; } + public global::Google.Gemini.SearchEntryPoint? Type6 { get; set; } /// /// /// - public string? Type7 { get; set; } + public byte[]? Type7 { get; set; } /// /// /// - public global::Google.Gemini.SafetyRating? Type8 { get; set; } + public global::Google.Gemini.RetrievalConfig? Type8 { get; set; } /// /// /// - public global::Google.Gemini.SafetyRatingCategory? Type9 { get; set; } + public global::Google.Gemini.LatLng? Type9 { get; set; } /// /// /// - public global::Google.Gemini.SafetyRatingProbability? Type10 { get; set; } + public double? Type10 { get; set; } /// /// /// - public bool? Type11 { get; set; } + public global::Google.Gemini.GroundingChunk? Type11 { get; set; } /// /// /// - public global::Google.Gemini.UsageMetadata? Type12 { get; set; } + public global::Google.Gemini.Web? Type12 { get; set; } /// /// /// - public int? Type13 { get; set; } + public global::Google.Gemini.Image? Type13 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type14 { get; set; } + public global::Google.Gemini.RetrievedContext? Type14 { get; set; } /// /// /// - public global::Google.Gemini.ModalityTokenCount? Type15 { get; set; } + public global::Google.Gemini.Maps? Type15 { get; set; } /// /// /// - public global::Google.Gemini.BatchGenerateContentRequest? Type16 { get; set; } + public global::Google.Gemini.CustomMetadata? Type16 { get; set; } /// /// /// - public global::Google.Gemini.GenerateContentBatch? Type17 { get; set; } + public global::Google.Gemini.StringList? Type17 { get; set; } /// /// /// - public global::Google.Gemini.CreateFileResponse? Type18 { get; set; } + public float? Type18 { get; set; } /// /// /// - public global::Google.Gemini.File? Type19 { get; set; } + public global::Google.Gemini.SpeechConfig? Type19 { get; set; } /// /// /// - public global::Google.Gemini.ChunkingConfig? Type20 { get; set; } + public global::Google.Gemini.MultiSpeakerVoiceConfig? Type20 { get; set; } /// /// /// - public global::Google.Gemini.WhiteSpaceConfig? Type21 { get; set; } + public global::Google.Gemini.VoiceConfig? Type21 { get; set; } /// /// /// - public global::Google.Gemini.ImageSearch? Type22 { get; set; } + public global::Google.Gemini.EmbedContentConfig? Type22 { get; set; } /// /// /// - public global::Google.Gemini.CountTokensResponse? Type23 { get; set; } + public bool? Type23 { get; set; } /// /// /// - public global::Google.Gemini.RetrievalConfig? Type24 { get; set; } + public global::Google.Gemini.EmbedContentConfigTaskType? Type24 { get; set; } /// /// /// - public global::Google.Gemini.LatLng? Type25 { get; set; } + public int? Type25 { get; set; } /// /// /// - public global::Google.Gemini.Corpus? Type26 { get; set; } + public global::Google.Gemini.FunctionResponsePart? Type26 { get; set; } /// /// /// - public global::Google.Gemini.PromptFeedback? Type27 { get; set; } + public global::Google.Gemini.FunctionResponseBlob? Type27 { get; set; } /// /// /// - public global::Google.Gemini.PromptFeedbackBlockReason? Type28 { get; set; } + public global::Google.Gemini.TunedModel? Type28 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type29 { get; set; } + public global::Google.Gemini.TuningTask? Type29 { get; set; } /// /// /// @@ -152,55 +152,55 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Google.Gemini.SpeechConfig? Type31 { get; set; } + public global::Google.Gemini.TunedModelState? Type31 { get; set; } /// /// /// - public global::Google.Gemini.MultiSpeakerVoiceConfig? Type32 { get; set; } + public global::Google.Gemini.InlinedEmbedContentResponses? Type32 { get; set; } /// /// /// - public global::Google.Gemini.VoiceConfig? Type33 { get; set; } + public global::System.Collections.Generic.IList? Type33 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentRequest? Type34 { get; set; } + public global::Google.Gemini.InlinedEmbedContentResponse? Type34 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentRequestTaskType? Type35 { get; set; } + public global::Google.Gemini.Interval? Type35 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentConfig? Type36 { get; set; } + public global::Google.Gemini.GenerateContentRequest? Type36 { get; set; } /// /// /// - public global::Google.Gemini.Content? Type37 { get; set; } + public global::Google.Gemini.GenerationConfig? Type37 { get; set; } /// /// /// - public global::Google.Gemini.GenerateContentRequest? Type38 { get; set; } + public global::System.Collections.Generic.IList? Type38 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type39 { get; set; } + public global::Google.Gemini.Tool? Type39 { get; set; } /// /// /// - public global::Google.Gemini.ToolConfig? Type40 { get; set; } + public global::Google.Gemini.GenerateContentRequestServiceTier? Type40 { get; set; } /// /// /// - public global::Google.Gemini.GenerateContentRequestServiceTier? Type41 { get; set; } + public global::Google.Gemini.Content? Type41 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type42 { get; set; } + public global::Google.Gemini.ToolConfig? Type42 { get; set; } /// /// /// - public global::Google.Gemini.Tool? Type43 { get; set; } + public global::System.Collections.Generic.IList? Type43 { get; set; } /// /// /// @@ -212,928 +212,928 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Google.Gemini.GenerationConfig? Type46 { get; set; } + public global::Google.Gemini.SpeakerVoiceConfig? Type46 { get; set; } /// /// /// - public global::Google.Gemini.Empty? Type47 { get; set; } + public global::Google.Gemini.GroundingChunkCustomMetadata? Type47 { get; set; } /// /// /// - public global::Google.Gemini.Schema? Type48 { get; set; } + public global::Google.Gemini.GroundingChunkStringList? Type48 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type49 { get; set; } + public global::Google.Gemini.ListCorporaResponse? Type49 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type50 { get; set; } + public global::System.Collections.Generic.IList? Type50 { get; set; } /// /// /// - public global::Google.Gemini.SchemaType? Type51 { get; set; } + public global::Google.Gemini.Corpus? Type51 { get; set; } /// /// /// - public object? Type52 { get; set; } + public global::Google.Gemini.GenerateContentBatch? Type52 { get; set; } /// /// /// - public double? Type53 { get; set; } + public global::Google.Gemini.InputConfig? Type53 { get; set; } /// /// /// - public global::Google.Gemini.Permission? Type54 { get; set; } + public global::Google.Gemini.GenerateContentBatchState? Type54 { get; set; } /// /// /// - public global::Google.Gemini.PermissionRole? Type55 { get; set; } + public global::Google.Gemini.BatchStats? Type55 { get; set; } /// /// /// - public global::Google.Gemini.PermissionGranteeType? Type56 { get; set; } + public global::Google.Gemini.GenerateContentBatchOutput? Type56 { get; set; } /// /// /// - public global::Google.Gemini.FileData? Type57 { get; set; } + public global::Google.Gemini.TopCandidates? Type57 { get; set; } /// /// /// - public global::Google.Gemini.TransferOwnershipResponse? Type58 { get; set; } + public global::System.Collections.Generic.IList? Type58 { get; set; } /// /// /// - public global::Google.Gemini.TopCandidates? Type59 { get; set; } + public global::Google.Gemini.LogprobsResultCandidate? Type59 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type60 { get; set; } + public global::Google.Gemini.CountTokensRequest? Type60 { get; set; } /// /// /// - public global::Google.Gemini.LogprobsResultCandidate? Type61 { get; set; } + public global::Google.Gemini.EmbedContentResponse? Type61 { get; set; } /// /// /// - public global::Google.Gemini.Document? Type62 { get; set; } + public global::Google.Gemini.ContentEmbedding? Type62 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type63 { get; set; } + public global::Google.Gemini.EmbeddingUsageMetadata? Type63 { get; set; } /// /// /// - public global::Google.Gemini.CustomMetadata? Type64 { get; set; } + public global::Google.Gemini.TuningExamples? Type64 { get; set; } /// /// /// - public global::Google.Gemini.DocumentState? Type65 { get; set; } + public global::System.Collections.Generic.IList? Type65 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentConfigTaskType? Type66 { get; set; } + public global::Google.Gemini.TuningExample? Type66 { get; set; } /// /// /// - public global::Google.Gemini.ReviewSnippet? Type67 { get; set; } + public global::Google.Gemini.GenerateContentResponse? Type67 { get; set; } /// /// /// - public global::Google.Gemini.FileSearchStore? Type68 { get; set; } + public global::Google.Gemini.PromptFeedback? Type68 { get; set; } /// /// /// - public global::Google.Gemini.ListPermissionsResponse? Type69 { get; set; } + public global::System.Collections.Generic.IList? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::Google.Gemini.Candidate? Type70 { get; set; } /// /// /// - public global::Google.Gemini.GoogleSearchRetrieval? Type71 { get; set; } + public global::Google.Gemini.UsageMetadata? Type71 { get; set; } /// /// /// - public global::Google.Gemini.DynamicRetrievalConfig? Type72 { get; set; } + public global::Google.Gemini.ModelStatus? Type72 { get; set; } /// /// /// - public global::Google.Gemini.PrebuiltVoiceConfig? Type73 { get; set; } + public global::Google.Gemini.PlaceAnswerSources? Type73 { get; set; } /// /// /// - public global::Google.Gemini.PlaceAnswerSources? Type74 { get; set; } + public global::Google.Gemini.BatchEmbedContentsResponse? Type74 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type75 { get; set; } + public global::System.Collections.Generic.IList? Type75 { get; set; } /// /// /// - public global::Google.Gemini.ModelStatus? Type76 { get; set; } + public global::Google.Gemini.InputEmbedContentConfig? Type76 { get; set; } /// /// /// - public global::Google.Gemini.ModelStatusModelStage? Type77 { get; set; } + public global::Google.Gemini.InlinedEmbedContentRequests? Type77 { get; set; } /// /// /// - public global::Google.Gemini.ListDocumentsResponse? Type78 { get; set; } + public global::Google.Gemini.File? Type78 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type79 { get; set; } + public global::Google.Gemini.Status? Type79 { get; set; } /// /// /// - public float? Type80 { get; set; } + public global::Google.Gemini.FileSource? Type80 { get; set; } /// /// /// - public global::Google.Gemini.ImportFileRequest? Type81 { get; set; } + public global::Google.Gemini.FileState? Type81 { get; set; } /// /// /// - public global::Google.Gemini.FunctionDeclaration? Type82 { get; set; } + public global::Google.Gemini.VideoFileMetadata? Type82 { get; set; } /// /// /// - public global::Google.Gemini.FunctionDeclarationBehavior? Type83 { get; set; } + public global::Google.Gemini.TransferOwnershipRequest? Type83 { get; set; } /// /// /// - public global::Google.Gemini.ThinkingConfig? Type84 { get; set; } + public global::Google.Gemini.PrebuiltVoiceConfig? Type84 { get; set; } /// /// /// - public global::Google.Gemini.ThinkingConfigThinkingLevel? Type85 { get; set; } + public global::Google.Gemini.ChunkingConfig? Type85 { get; set; } /// /// /// - public global::Google.Gemini.CountTokensRequest? Type86 { get; set; } + public global::Google.Gemini.WhiteSpaceConfig? Type86 { get; set; } /// /// /// - public global::Google.Gemini.InlinedEmbedContentResponses? Type87 { get; set; } + public global::Google.Gemini.EmbedContentBatchOutput? Type87 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type88 { get; set; } + public global::Google.Gemini.ListGeneratedFilesResponse? Type88 { get; set; } /// /// /// - public global::Google.Gemini.InlinedEmbedContentResponse? Type89 { get; set; } + public global::System.Collections.Generic.IList? Type89 { get; set; } /// /// /// - public global::Google.Gemini.BatchEmbedContentsResponse? Type90 { get; set; } + public global::Google.Gemini.GeneratedFile? Type90 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type91 { get; set; } + public global::System.Collections.Generic.IList? Type91 { get; set; } /// /// /// - public global::Google.Gemini.ContentEmbedding? Type92 { get; set; } + public global::Google.Gemini.ModalityTokenCount? Type92 { get; set; } /// /// /// - public global::Google.Gemini.EmbeddingUsageMetadata? Type93 { get; set; } + public global::Google.Gemini.ListFileSearchStoresResponse? Type93 { get; set; } /// /// /// - public global::Google.Gemini.VideoFileMetadata? Type94 { get; set; } + public global::System.Collections.Generic.IList? Type94 { get; set; } /// /// /// - public global::Google.Gemini.TransferOwnershipRequest? Type95 { get; set; } + public global::Google.Gemini.FileSearchStore? Type95 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentBatch? Type96 { get; set; } + public global::Google.Gemini.BatchEmbedContentsRequest? Type96 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentBatchState? Type97 { get; set; } + public global::System.Collections.Generic.IList? Type97 { get; set; } /// /// /// - public global::Google.Gemini.InputEmbedContentConfig? Type98 { get; set; } + public global::Google.Gemini.EmbedContentRequest? Type98 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentBatchOutput? Type99 { get; set; } + public global::Google.Gemini.TuningSnapshot? Type99 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentBatchStats? Type100 { get; set; } + public global::Google.Gemini.SemanticRetrieverChunk? Type100 { get; set; } /// /// /// - public global::Google.Gemini.InlinedResponses? Type101 { get; set; } + public global::Google.Gemini.GroundingMetadata? Type101 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type102 { get; set; } + public global::System.Collections.Generic.IList? Type102 { get; set; } /// /// /// - public global::Google.Gemini.InlinedResponse? Type103 { get; set; } + public global::System.Collections.Generic.IList? Type103 { get; set; } /// /// /// - public global::Google.Gemini.RetrievedContext? Type104 { get; set; } + public global::Google.Gemini.GoogleAiGenerativelanguageV1betaGroundingSupport? Type104 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type105 { get; set; } + public global::Google.Gemini.RetrievalMetadata? Type105 { get; set; } /// /// /// - public global::Google.Gemini.GroundingChunkCustomMetadata? Type106 { get; set; } + public global::System.Collections.Generic.IList? Type106 { get; set; } /// /// /// - public global::Google.Gemini.InlinedRequests? Type107 { get; set; } + public global::Google.Gemini.Part? Type107 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type108 { get; set; } + public global::System.Collections.Generic.IList? Type108 { get; set; } /// /// /// - public global::Google.Gemini.InlinedRequest? Type109 { get; set; } + public global::Google.Gemini.InlinedEmbedContentRequest? Type109 { get; set; } /// /// /// - public global::Google.Gemini.StringList? Type110 { get; set; } + public global::Google.Gemini.InlinedRequests? Type110 { get; set; } /// /// /// - public global::Google.Gemini.EmbedContentResponse? Type111 { get; set; } + public global::System.Collections.Generic.IList? Type111 { get; set; } /// /// /// - public global::Google.Gemini.CitationMetadata? Type112 { get; set; } + public global::Google.Gemini.InlinedRequest? Type112 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type113 { get; set; } + public global::Google.Gemini.Model? Type113 { get; set; } /// /// /// - public global::Google.Gemini.CitationSource? Type114 { get; set; } + public global::Google.Gemini.CodeExecution? Type114 { get; set; } /// /// /// - public global::Google.Gemini.GroundingChunkStringList? Type115 { get; set; } + public global::Google.Gemini.FileSearch? Type115 { get; set; } /// /// /// - public global::Google.Gemini.Dataset? Type116 { get; set; } + public global::Google.Gemini.GoogleSearchRetrieval? Type116 { get; set; } /// /// /// - public global::Google.Gemini.TuningExamples? Type117 { get; set; } + public global::Google.Gemini.DynamicRetrievalConfig? Type117 { get; set; } /// /// /// - public global::Google.Gemini.GroundingPassageId? Type118 { get; set; } + public global::Google.Gemini.PromptFeedbackBlockReason? Type118 { get; set; } /// /// /// - public global::Google.Gemini.ListGeneratedFilesResponse? Type119 { get; set; } + public global::System.Collections.Generic.IList? Type119 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type120 { get; set; } + public global::Google.Gemini.SafetyRating? Type120 { get; set; } /// /// /// - public global::Google.Gemini.GeneratedFile? Type121 { get; set; } + public global::Google.Gemini.Dataset? Type121 { get; set; } /// /// /// - public global::Google.Gemini.Blob? Type122 { get; set; } + public global::Google.Gemini.WebSearch? Type122 { get; set; } /// /// /// - public byte[]? Type123 { get; set; } + public global::Google.Gemini.Document? Type123 { get; set; } /// /// /// - public global::Google.Gemini.SearchEntryPoint? Type124 { get; set; } + public global::Google.Gemini.DocumentState? Type124 { get; set; } /// /// /// - public global::Google.Gemini.LogprobsResult? Type125 { get; set; } + public global::System.Collections.Generic.IList? Type125 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type126 { get; set; } + public global::Google.Gemini.GroundingAttribution? Type126 { get; set; } /// /// /// - public global::Google.Gemini.ImageConfig? Type127 { get; set; } + public global::Google.Gemini.AttributionSourceId? Type127 { get; set; } /// /// /// - public global::Google.Gemini.GoogleAiGenerativelanguageV1betaSegment? Type128 { get; set; } + public global::Google.Gemini.CustomLongRunningOperation? Type128 { get; set; } /// /// /// - public global::Google.Gemini.ListFilesResponse? Type129 { get; set; } + public object? Type129 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type130 { get; set; } + public global::Google.Gemini.FunctionDeclaration? Type130 { get; set; } /// /// /// - public global::Google.Gemini.ListFileSearchStoresResponse? Type131 { get; set; } + public global::Google.Gemini.Schema? Type131 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type132 { get; set; } + public global::Google.Gemini.FunctionDeclarationBehavior? Type132 { get; set; } /// /// /// - public global::Google.Gemini.FileSource? Type133 { get; set; } + public global::Google.Gemini.ExecutableCode? Type133 { get; set; } /// /// /// - public global::Google.Gemini.FileState? Type134 { get; set; } + public global::Google.Gemini.ExecutableCodeLanguage? Type134 { get; set; } /// /// /// - public global::Google.Gemini.Status? Type135 { get; set; } + public global::Google.Gemini.ListTunedModelsResponse? Type135 { get; set; } /// /// /// - public global::Google.Gemini.GenerateContentBatchOutput? Type136 { get; set; } + public global::System.Collections.Generic.IList? Type136 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type137 { get; set; } + public global::Google.Gemini.Operation? Type137 { get; set; } /// /// /// - public global::Google.Gemini.GroundingAttribution? Type138 { get; set; } + public global::Google.Gemini.FunctionCall? Type138 { get; set; } /// /// /// - public global::Google.Gemini.AttributionSourceId? Type139 { get; set; } + public global::Google.Gemini.TransferOwnershipResponse? Type139 { get; set; } /// /// /// - public global::Google.Gemini.FunctionResponsePart? Type140 { get; set; } + public global::Google.Gemini.Permission? Type140 { get; set; } /// /// /// - public global::Google.Gemini.FunctionResponseBlob? Type141 { get; set; } + public global::Google.Gemini.PermissionGranteeType? Type141 { get; set; } /// /// /// - public global::Google.Gemini.ComputerUse? Type142 { get; set; } + public global::Google.Gemini.PermissionRole? Type142 { get; set; } /// /// /// - public global::Google.Gemini.ComputerUseEnvironment? Type143 { get; set; } + public global::Google.Gemini.SafetyRatingProbability? Type143 { get; set; } /// /// /// - public global::Google.Gemini.GenerateContentResponse? Type144 { get; set; } + public global::Google.Gemini.SafetyRatingCategory? Type144 { get; set; } /// /// /// - public global::Google.Gemini.FileSearch? Type145 { get; set; } + public global::Google.Gemini.SafetySettingCategory? Type145 { get; set; } /// /// /// - public global::Google.Gemini.InputConfig? Type146 { get; set; } + public global::Google.Gemini.SafetySettingThreshold? Type146 { get; set; } /// /// /// - public global::Google.Gemini.UrlContextMetadata? Type147 { get; set; } + public global::Google.Gemini.GoogleMaps? Type147 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type148 { get; set; } + public global::System.Collections.Generic.Dictionary? Type148 { get; set; } /// /// /// - public global::Google.Gemini.UrlMetadata? Type149 { get; set; } + public global::Google.Gemini.SchemaType? Type149 { get; set; } /// /// /// - public global::Google.Gemini.ListCachedContentsResponse? Type150 { get; set; } + public global::System.Collections.Generic.IList? Type150 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type151 { get; set; } + public global::Google.Gemini.RegisterFilesResponse? Type151 { get; set; } /// /// /// - public global::Google.Gemini.CachedContent? Type152 { get; set; } + public global::System.Collections.Generic.IList? Type152 { get; set; } /// /// /// - public global::Google.Gemini.Hyperparameters? Type153 { get; set; } + public global::Google.Gemini.ComputerUse? Type153 { get; set; } /// /// /// - public global::Google.Gemini.GroundingChunk? Type154 { get; set; } + public global::Google.Gemini.ComputerUseEnvironment? Type154 { get; set; } /// /// /// - public global::Google.Gemini.Web? Type155 { get; set; } + public global::Google.Gemini.CachedContentUsageMetadata? Type155 { get; set; } /// /// /// - public global::Google.Gemini.Image? Type156 { get; set; } + public global::Google.Gemini.GroundingPassageId? Type156 { get; set; } /// /// /// - public global::Google.Gemini.Maps? Type157 { get; set; } + public global::Google.Gemini.SearchTypes? Type157 { get; set; } /// /// /// - public global::Google.Gemini.CachedContentUsageMetadata? Type158 { get; set; } + public global::Google.Gemini.ImageSearch? Type158 { get; set; } /// /// /// - public global::Google.Gemini.TuningExample? Type159 { get; set; } + public global::System.Collections.Generic.IList? Type159 { get; set; } /// /// /// - public global::Google.Gemini.GoogleMaps? Type160 { get; set; } + public global::Google.Gemini.VideoMetadata? Type160 { get; set; } /// /// /// - public global::Google.Gemini.UrlMetadataUrlRetrievalStatus? Type161 { get; set; } + public global::Google.Gemini.ListModelsResponse? Type161 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type162 { get; set; } + public global::System.Collections.Generic.IList? Type162 { get; set; } /// /// /// - public global::Google.Gemini.Part? Type163 { get; set; } + public global::Google.Gemini.CountTokensResponse? Type163 { get; set; } /// /// /// - public global::Google.Gemini.FunctionResponse? Type164 { get; set; } + public global::Google.Gemini.UploadToFileSearchStoreRequest? Type164 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type165 { get; set; } + public global::Google.Gemini.ThinkingConfig? Type165 { get; set; } /// /// /// - public global::Google.Gemini.FunctionResponseScheduling? Type166 { get; set; } + public global::Google.Gemini.ThinkingConfigThinkingLevel? Type166 { get; set; } /// /// /// - public global::Google.Gemini.Model? Type167 { get; set; } + public global::Google.Gemini.ImageConfig? Type167 { get; set; } /// /// /// - public global::Google.Gemini.StreamableHttpTransport? Type168 { get; set; } + public global::System.Collections.Generic.IList? Type168 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type169 { get; set; } + public global::Google.Gemini.GenerationConfigResponseModalitie? Type169 { get; set; } /// /// /// - public global::Google.Gemini.RetrievalMetadata? Type170 { get; set; } + public global::Google.Gemini.GenerationConfigMediaResolution? Type170 { get; set; } /// /// /// - public global::Google.Gemini.ToolCall? Type171 { get; set; } + public global::Google.Gemini.Blob? Type171 { get; set; } /// /// /// - public global::Google.Gemini.ToolCallToolType? Type172 { get; set; } + public global::Google.Gemini.UrlContextMetadata? Type172 { get; set; } /// /// /// - public global::Google.Gemini.McpServer? Type173 { get; set; } + public global::System.Collections.Generic.IList? Type173 { get; set; } /// /// /// - public global::Google.Gemini.ListModelsResponse? Type174 { get; set; } + public global::Google.Gemini.CandidateFinishReason? Type174 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type175 { get; set; } + public global::Google.Gemini.CitationMetadata? Type175 { get; set; } /// /// /// - public global::Google.Gemini.TuningSnapshot? Type176 { get; set; } + public global::Google.Gemini.LogprobsResult? Type176 { get; set; } /// /// /// - public global::Google.Gemini.RegisterFilesResponse? Type177 { get; set; } + public global::Google.Gemini.ListPermissionsResponse? Type177 { get; set; } /// /// /// - public global::Google.Gemini.CodeExecution? Type178 { get; set; } + public global::System.Collections.Generic.IList? Type178 { get; set; } /// /// /// - public global::Google.Gemini.UploadToFileSearchStoreRequest? Type179 { get; set; } + public global::Google.Gemini.GoogleSearch? Type179 { get; set; } /// /// /// - public global::Google.Gemini.CreateFileRequest? Type180 { get; set; } + public global::System.Collections.Generic.IList? Type180 { get; set; } /// /// /// - public global::Google.Gemini.GoogleAiGenerativelanguageV1betaGroundingSupport? Type181 { get; set; } + public global::Google.Gemini.McpServer? Type181 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type182 { get; set; } + public global::System.Collections.Generic.IList? Type182 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type183 { get; set; } + public global::Google.Gemini.UrlContext? Type183 { get; set; } /// /// /// - public global::Google.Gemini.Candidate? Type184 { get; set; } + public global::Google.Gemini.ReviewSnippet? Type184 { get; set; } /// /// /// - public global::Google.Gemini.CandidateFinishReason? Type185 { get; set; } + public global::Google.Gemini.FunctionResponse? Type185 { get; set; } /// /// /// - public global::Google.Gemini.GroundingMetadata? Type186 { get; set; } + public global::System.Collections.Generic.IList? Type186 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type187 { get; set; } + public global::Google.Gemini.FunctionResponseScheduling? Type187 { get; set; } /// /// /// - public global::Google.Gemini.SafetySettingCategory? Type188 { get; set; } + public global::Google.Gemini.ToolResponse? Type188 { get; set; } /// /// /// - public global::Google.Gemini.SafetySettingThreshold? Type189 { get; set; } + public global::Google.Gemini.CodeExecutionResult? Type189 { get; set; } /// /// /// - public global::Google.Gemini.ToolResponse? Type190 { get; set; } + public global::Google.Gemini.ToolCall? Type190 { get; set; } /// /// /// - public global::Google.Gemini.ToolResponseToolType? Type191 { get; set; } + public global::Google.Gemini.FileData? Type191 { get; set; } /// /// /// - public global::Google.Gemini.GenerateContentBatchState? Type192 { get; set; } + public global::Google.Gemini.ToolResponseToolType? Type192 { get; set; } /// /// /// - public global::Google.Gemini.BatchStats? Type193 { get; set; } + public global::Google.Gemini.RegisterFilesRequest? Type193 { get; set; } /// /// /// - public global::Google.Gemini.AsyncBatchEmbedContentRequest? Type194 { get; set; } + public global::Google.Gemini.GoogleAiGenerativelanguageV1betaSegment? Type194 { get; set; } /// /// /// - public global::Google.Gemini.InlinedEmbedContentRequest? Type195 { get; set; } + public global::System.Collections.Generic.IList? Type195 { get; set; } /// /// /// - public global::Google.Gemini.WebSearch? Type196 { get; set; } + public global::System.Collections.Generic.IList? Type196 { get; set; } /// /// /// - public global::Google.Gemini.CustomLongRunningOperation? Type197 { get; set; } + public global::Google.Gemini.Empty? Type197 { get; set; } /// /// /// - public global::Google.Gemini.FunctionCall? Type198 { get; set; } + public global::Google.Gemini.InlinedResponse? Type198 { get; set; } /// /// /// - public global::Google.Gemini.VideoMetadata? Type199 { get; set; } + public global::Google.Gemini.StreamableHttpTransport? Type199 { get; set; } /// /// /// - public global::Google.Gemini.ExecutableCode? Type200 { get; set; } + public global::Google.Gemini.ModalityTokenCountModality? Type200 { get; set; } /// /// /// - public global::Google.Gemini.CodeExecutionResult? Type201 { get; set; } + public global::Google.Gemini.CodeExecutionResultOutcome? Type201 { get; set; } /// /// /// - public global::Google.Gemini.GeneratedFileState? Type202 { get; set; } + public global::Google.Gemini.ListCachedContentsResponse? Type202 { get; set; } /// /// /// - public global::Google.Gemini.DynamicRetrievalConfigMode? Type203 { get; set; } + public global::System.Collections.Generic.IList? Type203 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type204 { get; set; } + public global::Google.Gemini.CachedContent? Type204 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type205 { get; set; } + public global::Google.Gemini.ToolCallToolType? Type205 { get; set; } /// /// /// - public global::Google.Gemini.UrlContext? Type206 { get; set; } + public global::Google.Gemini.BatchGenerateContentRequest? Type206 { get; set; } /// /// /// - public global::Google.Gemini.FunctionCallingConfig? Type207 { get; set; } + public global::Google.Gemini.ListDocumentsResponse? Type207 { get; set; } /// /// /// - public global::Google.Gemini.FunctionCallingConfigMode? Type208 { get; set; } + public global::System.Collections.Generic.IList? Type208 { get; set; } /// /// /// - public global::Google.Gemini.GenerationConfigMediaResolution? Type209 { get; set; } + public global::System.Collections.Generic.IList? Type209 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type210 { get; set; } + public global::Google.Gemini.InlinedResponses? Type210 { get; set; } /// /// /// - public global::Google.Gemini.GenerationConfigResponseModalitie? Type211 { get; set; } + public global::System.Collections.Generic.IList? Type211 { get; set; } /// /// /// - public global::Google.Gemini.TunedModel? Type212 { get; set; } + public global::Google.Gemini.CreateFileRequest? Type212 { get; set; } /// /// /// - public global::Google.Gemini.TunedModelState? Type213 { get; set; } + public global::Google.Gemini.GeneratedFileState? Type213 { get; set; } /// /// /// - public global::Google.Gemini.TuningTask? Type214 { get; set; } + public global::Google.Gemini.CreateFileResponse? Type214 { get; set; } /// /// /// - public global::Google.Gemini.SpeakerVoiceConfig? Type215 { get; set; } + public global::Google.Gemini.AsyncBatchEmbedContentRequest? Type215 { get; set; } /// /// /// - public global::Google.Gemini.ExecutableCodeLanguage? Type216 { get; set; } + public global::Google.Gemini.EmbedContentBatch? Type216 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type217 { get; set; } + public global::Google.Gemini.ModelStatusModelStage? Type217 { get; set; } /// /// /// - public global::Google.Gemini.SemanticRetrieverChunk? Type218 { get; set; } + public global::Google.Gemini.CitationSource? Type218 { get; set; } /// /// /// - public global::Google.Gemini.InlinedEmbedContentRequests? Type219 { get; set; } + public global::Google.Gemini.ListOperationsResponse? Type219 { get; set; } /// /// /// - public global::Google.Gemini.ModalityTokenCountModality? Type220 { get; set; } + public global::System.Collections.Generic.IList? Type220 { get; set; } /// /// /// - public global::Google.Gemini.RegisterFilesRequest? Type221 { get; set; } + public global::System.Collections.Generic.IList? Type221 { get; set; } /// /// /// - public global::Google.Gemini.ListCorporaResponse? Type222 { get; set; } + public global::System.Collections.Generic.IList? Type222 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type223 { get; set; } + public global::System.Collections.Generic.IList? Type223 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type224 { get; set; } + public global::Google.Gemini.Hyperparameters? Type224 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type225 { get; set; } + public global::Google.Gemini.ImportFileRequest? Type225 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type226 { get; set; } + public global::Google.Gemini.DynamicRetrievalConfigMode? Type226 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type227 { get; set; } + public global::Google.Gemini.EmbedContentBatchStats? Type227 { get; set; } /// /// /// - public global::Google.Gemini.CodeExecutionResultOutcome? Type228 { get; set; } + public global::Google.Gemini.ListFilesResponse? Type228 { get; set; } /// /// /// - public global::Google.Gemini.BatchEmbedContentsRequest? Type229 { get; set; } + public global::System.Collections.Generic.IList? Type229 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type230 { get; set; } + public global::Google.Gemini.EmbedContentRequestTaskType? Type230 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type231 { get; set; } + public global::Google.Gemini.EmbedContentBatchState? Type231 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type232 { get; set; } + public global::System.Collections.Generic.IList? Type232 { get; set; } /// /// /// - public global::Google.Gemini.ListTunedModelsResponse? Type233 { get; set; } + public global::System.Collections.Generic.IList? Type233 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type234 { get; set; } + public global::System.Collections.Generic.Dictionary? Type234 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType0 { get; set; } + public global::System.Collections.Generic.List? ListType0 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType1 { get; set; } + public global::System.Collections.Generic.List? ListType1 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType2 { get; set; } + public global::System.Collections.Generic.List? ListType2 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType3 { get; set; } + public global::System.Collections.Generic.List? ListType3 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType4 { get; set; } + public global::System.Collections.Generic.List? ListType4 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType5 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::System.Collections.Generic.List? ListType6 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType7 { get; set; } + public global::System.Collections.Generic.List? ListType7 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType8 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType10 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType12 { get; set; } + public global::System.Collections.Generic.List? ListType12 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? ListType14 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType15 { get; set; } + public global::System.Collections.Generic.List? ListType15 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType17 { get; set; } + public global::System.Collections.Generic.List? ListType17 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType18 { get; set; } + public global::System.Collections.Generic.List? ListType18 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType19 { get; set; } + public global::System.Collections.Generic.List? ListType19 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType20 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::System.Collections.Generic.List? ListType21 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType28 { get; set; } + public global::System.Collections.Generic.List? ListType28 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType29 { get; set; } + public global::System.Collections.Generic.List? ListType29 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType30 { get; set; } + public global::System.Collections.Generic.List? ListType30 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType31 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType32 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType33 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType34 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::System.Collections.Generic.List? ListType35 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType36 { get; set; } + public global::System.Collections.Generic.List? ListType36 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType37 { get; set; } + public global::System.Collections.Generic.List? ListType37 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType38 { get; set; } + public global::System.Collections.Generic.List? ListType38 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List? ListType39 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType40 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType41 { get; set; } /// /// /// @@ -1141,10 +1141,10 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType43 { get; set; } + public global::System.Collections.Generic.List? ListType43 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType44 { get; set; } + public global::System.Collections.Generic.List? ListType44 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchEmbedContentsResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchEmbedContentsResponse.g.cs index aa89d8724..1c4f263ce 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchEmbedContentsResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchEmbedContentsResponse.g.cs @@ -8,6 +8,12 @@ namespace Google.Gemini /// public sealed partial class BatchEmbedContentsResponse { + /// + /// Metadata on the usage of the embedding request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("usageMetadata")] + public global::Google.Gemini.EmbeddingUsageMetadata? UsageMetadata { get; set; } + /// /// Output only. The embeddings for each request, in the same order as provided in the batch request.
/// Included only in responses @@ -15,12 +21,6 @@ public sealed partial class BatchEmbedContentsResponse [global::System.Text.Json.Serialization.JsonPropertyName("embeddings")] public global::System.Collections.Generic.IList? Embeddings { get; set; } - /// - /// Metadata on the usage of the embedding request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("usageMetadata")] - public global::Google.Gemini.EmbeddingUsageMetadata? UsageMetadata { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -30,22 +30,22 @@ public sealed partial class BatchEmbedContentsResponse /// /// Initializes a new instance of the class. /// + /// + /// Metadata on the usage of the embedding request. + /// /// /// Output only. The embeddings for each request, in the same order as provided in the batch request.
/// Included only in responses /// - /// - /// Metadata on the usage of the embedding request. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public BatchEmbedContentsResponse( - global::System.Collections.Generic.IList? embeddings, - global::Google.Gemini.EmbeddingUsageMetadata? usageMetadata) + global::Google.Gemini.EmbeddingUsageMetadata? usageMetadata, + global::System.Collections.Generic.IList? embeddings) { - this.Embeddings = embeddings; this.UsageMetadata = usageMetadata; + this.Embeddings = embeddings; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchStats.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchStats.g.cs index 2c8d807df..72da3cc56 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchStats.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.BatchStats.g.cs @@ -15,13 +15,6 @@ public sealed partial class BatchStats [global::System.Text.Json.Serialization.JsonPropertyName("requestCount")] public string? RequestCount { get; set; } - /// - /// Output only. The number of requests that were successfully processed.
- /// Included only in responses - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("successfulRequestCount")] - public string? SuccessfulRequestCount { get; set; } - /// /// Output only. The number of requests that failed to be processed.
/// Included only in responses @@ -36,6 +29,13 @@ public sealed partial class BatchStats [global::System.Text.Json.Serialization.JsonPropertyName("pendingRequestCount")] public string? PendingRequestCount { get; set; } + /// + /// Output only. The number of requests that were successfully processed.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("successfulRequestCount")] + public string? SuccessfulRequestCount { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -49,10 +49,6 @@ public sealed partial class BatchStats /// Output only. The number of requests in the batch.
/// Included only in responses /// - /// - /// Output only. The number of requests that were successfully processed.
- /// Included only in responses - /// /// /// Output only. The number of requests that failed to be processed.
/// Included only in responses @@ -61,19 +57,23 @@ public sealed partial class BatchStats /// Output only. The number of requests that are still pending processing.
/// Included only in responses /// + /// + /// Output only. The number of requests that were successfully processed.
+ /// Included only in responses + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public BatchStats( string? requestCount, - string? successfulRequestCount, string? failedRequestCount, - string? pendingRequestCount) + string? pendingRequestCount, + string? successfulRequestCount) { this.RequestCount = requestCount; - this.SuccessfulRequestCount = successfulRequestCount; this.FailedRequestCount = failedRequestCount; this.PendingRequestCount = pendingRequestCount; + this.SuccessfulRequestCount = successfulRequestCount; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CachedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CachedContent.g.cs index 815b7b4fd..928351399 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CachedContent.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CachedContent.g.cs @@ -9,17 +9,23 @@ namespace Google.Gemini public sealed partial class CachedContent { /// - /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. + /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response /// - [global::System.Text.Json.Serialization.JsonPropertyName("expireTime")] - public string? ExpireTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("tools")] + public global::System.Collections.Generic.IList? Tools { get; set; } /// - /// Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`
+ /// Input only. New TTL for this resource, input only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("ttl")] + public string? Ttl { get; set; } + + /// + /// Output only. Creation time of the cache entry.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] + public string? CreateTime { get; set; } /// /// Output only. When the cache entry was last updated in UTC time.
@@ -35,17 +41,10 @@ public sealed partial class CachedContent public string? Model { get; set; } /// - /// Output only. Creation time of the cache entry.
- /// Included only in responses - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] - public string? CreateTime { get; set; } - - /// - /// Optional. Input only. Immutable. The content to cache. + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// - [global::System.Text.Json.Serialization.JsonPropertyName("contents")] - public global::System.Collections.Generic.IList? Contents { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("systemInstruction")] + public global::Google.Gemini.Content? SystemInstruction { get; set; } /// /// The Tool configuration containing parameters for specifying `Tool` use in the request. @@ -54,10 +53,10 @@ public sealed partial class CachedContent public global::Google.Gemini.ToolConfig? ToolConfig { get; set; } /// - /// Input only. New TTL for this resource, input only. + /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. /// - [global::System.Text.Json.Serialization.JsonPropertyName("ttl")] - public string? Ttl { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("expireTime")] + public string? ExpireTime { get; set; } /// /// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. @@ -66,22 +65,23 @@ public sealed partial class CachedContent public string? DisplayName { get; set; } /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. + /// Optional. Input only. Immutable. The content to cache. /// - [global::System.Text.Json.Serialization.JsonPropertyName("systemInstruction")] - public global::Google.Gemini.Content? SystemInstruction { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("contents")] + public global::System.Collections.Generic.IList? Contents { get; set; } /// - /// Metadata on the usage of the cached content. + /// Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("usageMetadata")] - public global::Google.Gemini.CachedContentUsageMetadata? UsageMetadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } /// - /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response + /// Metadata on the usage of the cached content. /// - [global::System.Text.Json.Serialization.JsonPropertyName("tools")] - public global::System.Collections.Generic.IList? Tools { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("usageMetadata")] + public global::Google.Gemini.CachedContentUsageMetadata? UsageMetadata { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -92,11 +92,14 @@ public sealed partial class CachedContent /// /// Initializes a new instance of the class. /// - /// - /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. + /// + /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response /// - /// - /// Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`
+ /// + /// Input only. New TTL for this resource, input only. + /// + /// + /// Output only. Creation time of the cache entry.
/// Included only in responses /// /// @@ -106,60 +109,57 @@ public sealed partial class CachedContent /// /// Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}` /// - /// - /// Output only. Creation time of the cache entry.
- /// Included only in responses - /// - /// - /// Optional. Input only. Immutable. The content to cache. + /// + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// /// /// The Tool configuration containing parameters for specifying `Tool` use in the request. /// - /// - /// Input only. New TTL for this resource, input only. + /// + /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input. /// /// /// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters. /// - /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. + /// + /// Optional. Input only. Immutable. The content to cache. + /// + /// + /// Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`
+ /// Included only in responses /// /// /// Metadata on the usage of the cached content. /// - /// - /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CachedContent( - string? expireTime, - string? name, + global::System.Collections.Generic.IList? tools, + string? ttl, + string? createTime, string? updateTime, string? model, - string? createTime, - global::System.Collections.Generic.IList? contents, + global::Google.Gemini.Content? systemInstruction, global::Google.Gemini.ToolConfig? toolConfig, - string? ttl, + string? expireTime, string? displayName, - global::Google.Gemini.Content? systemInstruction, - global::Google.Gemini.CachedContentUsageMetadata? usageMetadata, - global::System.Collections.Generic.IList? tools) + global::System.Collections.Generic.IList? contents, + string? name, + global::Google.Gemini.CachedContentUsageMetadata? usageMetadata) { - this.ExpireTime = expireTime; - this.Name = name; + this.Tools = tools; + this.Ttl = ttl; + this.CreateTime = createTime; this.UpdateTime = updateTime; this.Model = model; - this.CreateTime = createTime; - this.Contents = contents; + this.SystemInstruction = systemInstruction; this.ToolConfig = toolConfig; - this.Ttl = ttl; + this.ExpireTime = expireTime; this.DisplayName = displayName; - this.SystemInstruction = systemInstruction; + this.Contents = contents; + this.Name = name; this.UsageMetadata = usageMetadata; - this.Tools = tools; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Candidate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Candidate.g.cs index 1d3a2e2f0..55d6e6d58 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Candidate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Candidate.g.cs @@ -9,16 +9,11 @@ namespace Google.Gemini public sealed partial class Candidate { /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("content")] - public global::Google.Gemini.Content? Content { get; set; } - - /// - /// Logprobs Result + /// Output only. Index of the candidate in the list of response candidates.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("logprobsResult")] - public global::Google.Gemini.LogprobsResult? LogprobsResult { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("index")] + public int? Index { get; set; } /// /// Output only. Token count for this candidate.
@@ -28,64 +23,69 @@ public sealed partial class Candidate public int? TokenCount { get; set; } /// - /// Output only. Average log probability score of the candidate.
- /// Included only in responses + /// Metadata returned to client when grounding is enabled. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("avgLogprobs")] - public double? AvgLogprobs { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("groundingMetadata")] + public global::Google.Gemini.GroundingMetadata? GroundingMetadata { get; set; } /// - /// Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
+ /// Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("finishReason")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.CandidateFinishReasonJsonConverter))] - public global::Google.Gemini.CandidateFinishReason? FinishReason { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("finishMessage")] + public string? FinishMessage { get; set; } /// - /// A collection of source attributions for a piece of content. + /// Metadata related to url context retrieval tool. /// - [global::System.Text.Json.Serialization.JsonPropertyName("citationMetadata")] - public global::Google.Gemini.CitationMetadata? CitationMetadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("urlContextMetadata")] + public global::Google.Gemini.UrlContextMetadata? UrlContextMetadata { get; set; } /// - /// Output only. Index of the candidate in the list of response candidates.
+ /// List of ratings for the safety of a response candidate. There is at most one rating per category. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("safetyRatings")] + public global::System.Collections.Generic.IList? SafetyRatings { get; set; } + + /// + /// Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("index")] - public int? Index { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("groundingAttributions")] + public global::System.Collections.Generic.IList? GroundingAttributions { get; set; } /// - /// Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.
+ /// Output only. Average log probability score of the candidate.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("finishMessage")] - public string? FinishMessage { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("avgLogprobs")] + public double? AvgLogprobs { get; set; } /// - /// Metadata returned to client when grounding is enabled. + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// - [global::System.Text.Json.Serialization.JsonPropertyName("groundingMetadata")] - public global::Google.Gemini.GroundingMetadata? GroundingMetadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + public global::Google.Gemini.Content? Content { get; set; } /// - /// Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.
+ /// Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("groundingAttributions")] - public global::System.Collections.Generic.IList? GroundingAttributions { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("finishReason")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.CandidateFinishReasonJsonConverter))] + public global::Google.Gemini.CandidateFinishReason? FinishReason { get; set; } /// - /// List of ratings for the safety of a response candidate. There is at most one rating per category. + /// A collection of source attributions for a piece of content. /// - [global::System.Text.Json.Serialization.JsonPropertyName("safetyRatings")] - public global::System.Collections.Generic.IList? SafetyRatings { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("citationMetadata")] + public global::Google.Gemini.CitationMetadata? CitationMetadata { get; set; } /// - /// Metadata related to url context retrieval tool. + /// Logprobs Result /// - [global::System.Text.Json.Serialization.JsonPropertyName("urlContextMetadata")] - public global::Google.Gemini.UrlContextMetadata? UrlContextMetadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("logprobsResult")] + public global::Google.Gemini.LogprobsResult? LogprobsResult { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -96,77 +96,77 @@ public sealed partial class Candidate /// /// Initializes a new instance of the class. /// - /// - /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. - /// - /// - /// Logprobs Result + /// + /// Output only. Index of the candidate in the list of response candidates.
+ /// Included only in responses /// /// /// Output only. Token count for this candidate.
/// Included only in responses /// - /// - /// Output only. Average log probability score of the candidate.
- /// Included only in responses + /// + /// Metadata returned to client when grounding is enabled. /// - /// - /// Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
+ /// + /// Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.
/// Included only in responses /// - /// - /// A collection of source attributions for a piece of content. + /// + /// Metadata related to url context retrieval tool. /// - /// - /// Output only. Index of the candidate in the list of response candidates.
+ /// + /// List of ratings for the safety of a response candidate. There is at most one rating per category. + /// + /// + /// Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.
/// Included only in responses /// - /// - /// Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.
+ /// + /// Output only. Average log probability score of the candidate.
/// Included only in responses /// - /// - /// Metadata returned to client when grounding is enabled. + /// + /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// - /// - /// Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.
+ /// + /// Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
/// Included only in responses /// - /// - /// List of ratings for the safety of a response candidate. There is at most one rating per category. + /// + /// A collection of source attributions for a piece of content. /// - /// - /// Metadata related to url context retrieval tool. + /// + /// Logprobs Result /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Candidate( - global::Google.Gemini.Content? content, - global::Google.Gemini.LogprobsResult? logprobsResult, + int? index, int? tokenCount, + global::Google.Gemini.GroundingMetadata? groundingMetadata, + string? finishMessage, + global::Google.Gemini.UrlContextMetadata? urlContextMetadata, + global::System.Collections.Generic.IList? safetyRatings, + global::System.Collections.Generic.IList? groundingAttributions, double? avgLogprobs, + global::Google.Gemini.Content? content, global::Google.Gemini.CandidateFinishReason? finishReason, global::Google.Gemini.CitationMetadata? citationMetadata, - int? index, - string? finishMessage, - global::Google.Gemini.GroundingMetadata? groundingMetadata, - global::System.Collections.Generic.IList? groundingAttributions, - global::System.Collections.Generic.IList? safetyRatings, - global::Google.Gemini.UrlContextMetadata? urlContextMetadata) + global::Google.Gemini.LogprobsResult? logprobsResult) { - this.Content = content; - this.LogprobsResult = logprobsResult; + this.Index = index; this.TokenCount = tokenCount; + this.GroundingMetadata = groundingMetadata; + this.FinishMessage = finishMessage; + this.UrlContextMetadata = urlContextMetadata; + this.SafetyRatings = safetyRatings; + this.GroundingAttributions = groundingAttributions; this.AvgLogprobs = avgLogprobs; + this.Content = content; this.FinishReason = finishReason; this.CitationMetadata = citationMetadata; - this.Index = index; - this.FinishMessage = finishMessage; - this.GroundingMetadata = groundingMetadata; - this.GroundingAttributions = groundingAttributions; - this.SafetyRatings = safetyRatings; - this.UrlContextMetadata = urlContextMetadata; + this.LogprobsResult = logprobsResult; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CitationSource.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CitationSource.g.cs index 229e50dbe..62bb0edfa 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CitationSource.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CitationSource.g.cs @@ -9,16 +9,10 @@ namespace Google.Gemini public sealed partial class CitationSource { /// - /// Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("startIndex")] - public int? StartIndex { get; set; } - - /// - /// Optional. URI that is attributed as a source for a portion of the text. + /// Optional. End of the attributed segment, exclusive. /// - [global::System.Text.Json.Serialization.JsonPropertyName("uri")] - public string? Uri { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("endIndex")] + public int? EndIndex { get; set; } /// /// Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations. @@ -27,10 +21,16 @@ public sealed partial class CitationSource public string? License { get; set; } /// - /// Optional. End of the attributed segment, exclusive. + /// Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes. /// - [global::System.Text.Json.Serialization.JsonPropertyName("endIndex")] - public int? EndIndex { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("startIndex")] + public int? StartIndex { get; set; } + + /// + /// Optional. URI that is attributed as a source for a portion of the text. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("uri")] + public string? Uri { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -41,31 +41,31 @@ public sealed partial class CitationSource /// /// Initializes a new instance of the class. /// + /// + /// Optional. End of the attributed segment, exclusive. + /// + /// + /// Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations. + /// /// /// Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes. /// /// /// Optional. URI that is attributed as a source for a portion of the text. /// - /// - /// Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations. - /// - /// - /// Optional. End of the attributed segment, exclusive. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CitationSource( - int? startIndex, - string? uri, + int? endIndex, string? license, - int? endIndex) + int? startIndex, + string? uri) { + this.EndIndex = endIndex; + this.License = license; this.StartIndex = startIndex; this.Uri = uri; - this.License = license; - this.EndIndex = endIndex; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CodeExecutionResult.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CodeExecutionResult.g.cs index c36154c68..1669c1ec4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CodeExecutionResult.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CodeExecutionResult.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class CodeExecutionResult { - /// - /// Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - public string? Id { get; set; } - /// /// Required. Outcome of the code execution. /// @@ -27,6 +21,12 @@ public sealed partial class CodeExecutionResult [global::System.Text.Json.Serialization.JsonPropertyName("output")] public string? Output { get; set; } + /// + /// Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -36,26 +36,26 @@ public sealed partial class CodeExecutionResult /// /// Initializes a new instance of the class. /// - /// - /// Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. - /// /// /// Required. Outcome of the code execution. /// /// /// Optional. Contains stdout when code execution is successful, stderr or other description otherwise. /// + /// + /// Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CodeExecutionResult( - string? id, global::Google.Gemini.CodeExecutionResultOutcome? outcome, - string? output) + string? output, + string? id) { - this.Id = id; this.Outcome = outcome; this.Output = output; + this.Id = id; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Corpus.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Corpus.g.cs index 6c8ec1fd2..80d0cd23b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Corpus.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Corpus.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class Corpus { - /// - /// Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" - /// - [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] - public string? DisplayName { get; set; } - /// /// Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the "corpora/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`
/// Included only in responses @@ -35,6 +29,12 @@ public sealed partial class Corpus [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] public string? UpdateTime { get; set; } + /// + /// Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" + /// + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -44,9 +44,6 @@ public sealed partial class Corpus /// /// Initializes a new instance of the class. /// - /// - /// Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" - /// /// /// Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the "corpora/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`
/// Included only in responses @@ -59,19 +56,22 @@ public sealed partial class Corpus /// Output only. The Timestamp of when the `Corpus` was last updated.
/// Included only in responses /// + /// + /// Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Corpus( - string? displayName, string? name, string? createTime, - string? updateTime) + string? updateTime, + string? displayName) { - this.DisplayName = displayName; this.Name = name; this.CreateTime = createTime; this.UpdateTime = updateTime; + this.DisplayName = displayName; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CountTokensResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CountTokensResponse.g.cs index 2db32ede4..c7b2ac1a1 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CountTokensResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CountTokensResponse.g.cs @@ -9,16 +9,11 @@ namespace Google.Gemini public sealed partial class CountTokensResponse { /// - /// The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("totalTokens")] - public int? TotalTokens { get; set; } - - /// - /// Number of tokens in the cached part of the prompt (the cached content). + /// Output only. List of modalities that were processed in the request input.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("cachedContentTokenCount")] - public int? CachedContentTokenCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("promptTokensDetails")] + public global::System.Collections.Generic.IList? PromptTokensDetails { get; set; } /// /// Output only. List of modalities that were processed in the cached content.
@@ -28,11 +23,16 @@ public sealed partial class CountTokensResponse public global::System.Collections.Generic.IList? CacheTokensDetails { get; set; } /// - /// Output only. List of modalities that were processed in the request input.
- /// Included only in responses + /// The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("promptTokensDetails")] - public global::System.Collections.Generic.IList? PromptTokensDetails { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("totalTokens")] + public int? TotalTokens { get; set; } + + /// + /// Number of tokens in the cached part of the prompt (the cached content). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cachedContentTokenCount")] + public int? CachedContentTokenCount { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -43,33 +43,33 @@ public sealed partial class CountTokensResponse /// /// Initializes a new instance of the class. /// - /// - /// The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative. - /// - /// - /// Number of tokens in the cached part of the prompt (the cached content). + /// + /// Output only. List of modalities that were processed in the request input.
+ /// Included only in responses /// /// /// Output only. List of modalities that were processed in the cached content.
/// Included only in responses /// - /// - /// Output only. List of modalities that were processed in the request input.
- /// Included only in responses + /// + /// The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative. + /// + /// + /// Number of tokens in the cached part of the prompt (the cached content). /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CountTokensResponse( - int? totalTokens, - int? cachedContentTokenCount, + global::System.Collections.Generic.IList? promptTokensDetails, global::System.Collections.Generic.IList? cacheTokensDetails, - global::System.Collections.Generic.IList? promptTokensDetails) + int? totalTokens, + int? cachedContentTokenCount) { + this.PromptTokensDetails = promptTokensDetails; + this.CacheTokensDetails = cacheTokensDetails; this.TotalTokens = totalTokens; this.CachedContentTokenCount = cachedContentTokenCount; - this.CacheTokensDetails = cacheTokensDetails; - this.PromptTokensDetails = promptTokensDetails; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomLongRunningOperation.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomLongRunningOperation.g.cs index 881d533a2..281ef6cfa 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomLongRunningOperation.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomLongRunningOperation.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class CustomLongRunningOperation { - /// - /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("done")] - public bool? Done { get; set; } - /// /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] public string? Name { get; set; } + /// + /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::Google.Gemini.Status? Error { get; set; } + /// /// The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. /// @@ -27,16 +27,16 @@ public sealed partial class CustomLongRunningOperation public object? Response { get; set; } /// - /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public object? Metadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("done")] + public bool? Done { get; set; } /// - /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public global::Google.Gemini.Status? Error { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public object? Metadata { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -47,36 +47,36 @@ public sealed partial class CustomLongRunningOperation /// /// Initializes a new instance of the class. /// - /// - /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. - /// /// /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. /// + /// + /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// /// /// The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. /// + /// + /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. + /// /// /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. /// - /// - /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CustomLongRunningOperation( - bool? done, string? name, + global::Google.Gemini.Status? error, object? response, - object? metadata, - global::Google.Gemini.Status? error) + bool? done, + object? metadata) { - this.Done = done; this.Name = name; + this.Error = error; this.Response = response; + this.Done = done; this.Metadata = metadata; - this.Error = error; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomMetadata.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomMetadata.g.cs index 466ae0787..e3b9a1726 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomMetadata.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.CustomMetadata.g.cs @@ -20,18 +20,18 @@ public sealed partial class CustomMetadata [global::System.Text.Json.Serialization.JsonPropertyName("stringListValue")] public global::Google.Gemini.StringList? StringListValue { get; set; } - /// - /// Required. The key of the metadata to store. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("key")] - public string? Key { get; set; } - /// /// The numeric value of the metadata to store. /// [global::System.Text.Json.Serialization.JsonPropertyName("numericValue")] public float? NumericValue { get; set; } + /// + /// Required. The key of the metadata to store. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + public string? Key { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -47,25 +47,25 @@ public sealed partial class CustomMetadata /// /// User provided string values assigned to a single metadata key. /// - /// - /// Required. The key of the metadata to store. - /// /// /// The numeric value of the metadata to store. /// + /// + /// Required. The key of the metadata to store. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CustomMetadata( string? stringValue, global::Google.Gemini.StringList? stringListValue, - string? key, - float? numericValue) + float? numericValue, + string? key) { this.StringValue = stringValue; this.StringListValue = stringListValue; - this.Key = key; this.NumericValue = numericValue; + this.Key = key; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Document.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Document.g.cs index 7e22c29b9..2ca2cb483 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Document.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Document.g.cs @@ -8,6 +8,12 @@ namespace Google.Gemini /// public sealed partial class Document { + /// + /// Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation" + /// + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + /// /// Output only. The Timestamp of when the `Document` was last updated.
/// Included only in responses @@ -16,18 +22,19 @@ public sealed partial class Document public string? UpdateTime { get; set; } /// - /// Output only. The mime type of the Document.
+ /// Output only. The Timestamp of when the `Document` was created.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("mimeType")] - public string? MimeType { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] + public string? CreateTime { get; set; } /// - /// Output only. The Timestamp of when the `Document` was created.
+ /// Output only. Current state of the `Document`.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] - public string? CreateTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.DocumentStateJsonConverter))] + public global::Google.Gemini.DocumentState? State { get; set; } /// /// Output only. The size of raw bytes ingested into the Document.
@@ -49,18 +56,11 @@ public sealed partial class Document public global::System.Collections.Generic.IList? CustomMetadata { get; set; } /// - /// Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation" - /// - [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] - public string? DisplayName { get; set; } - - /// - /// Output only. Current state of the `Document`.
+ /// Output only. The mime type of the Document.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("state")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.DocumentStateJsonConverter))] - public global::Google.Gemini.DocumentState? State { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("mimeType")] + public string? MimeType { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -71,18 +71,21 @@ public sealed partial class Document /// /// Initializes a new instance of the class. /// + /// + /// Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation" + /// /// /// Output only. The Timestamp of when the `Document` was last updated.
/// Included only in responses /// - /// - /// Output only. The mime type of the Document.
- /// Included only in responses - /// /// /// Output only. The Timestamp of when the `Document` was created.
/// Included only in responses /// + /// + /// Output only. Current state of the `Document`.
+ /// Included only in responses + /// /// /// Output only. The size of raw bytes ingested into the Document.
/// Included only in responses @@ -93,34 +96,31 @@ public sealed partial class Document /// /// Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`. /// - /// - /// Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation" - /// - /// - /// Output only. Current state of the `Document`.
+ /// + /// Output only. The mime type of the Document.
/// Included only in responses /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Document( + string? displayName, string? updateTime, - string? mimeType, string? createTime, + global::Google.Gemini.DocumentState? state, string? sizeBytes, string? name, global::System.Collections.Generic.IList? customMetadata, - string? displayName, - global::Google.Gemini.DocumentState? state) + string? mimeType) { + this.DisplayName = displayName; this.UpdateTime = updateTime; - this.MimeType = mimeType; this.CreateTime = createTime; + this.State = state; this.SizeBytes = sizeBytes; this.Name = name; this.CustomMetadata = customMetadata; - this.DisplayName = displayName; - this.State = state; + this.MimeType = mimeType; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.DynamicRetrievalConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.DynamicRetrievalConfig.g.cs index 26462678a..a57fba7a2 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.DynamicRetrievalConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.DynamicRetrievalConfig.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class DynamicRetrievalConfig { - /// - /// The threshold to be used in dynamic retrieval. If not set, a system default value is used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("dynamicThreshold")] - public float? DynamicThreshold { get; set; } - /// /// The mode of the predictor to be used in dynamic retrieval. /// @@ -21,6 +15,12 @@ public sealed partial class DynamicRetrievalConfig [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.DynamicRetrievalConfigModeJsonConverter))] public global::Google.Gemini.DynamicRetrievalConfigMode? Mode { get; set; } + /// + /// The threshold to be used in dynamic retrieval. If not set, a system default value is used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dynamicThreshold")] + public float? DynamicThreshold { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -30,21 +30,21 @@ public sealed partial class DynamicRetrievalConfig /// /// Initializes a new instance of the class. /// - /// - /// The threshold to be used in dynamic retrieval. If not set, a system default value is used. - /// /// /// The mode of the predictor to be used in dynamic retrieval. /// + /// + /// The threshold to be used in dynamic retrieval. If not set, a system default value is used. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public DynamicRetrievalConfig( - float? dynamicThreshold, - global::Google.Gemini.DynamicRetrievalConfigMode? mode) + global::Google.Gemini.DynamicRetrievalConfigMode? mode, + float? dynamicThreshold) { - this.DynamicThreshold = dynamicThreshold; this.Mode = mode; + this.DynamicThreshold = dynamicThreshold; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatch.g.cs index 7d6033dc8..66082088d 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatch.g.cs @@ -8,6 +8,12 @@ namespace Google.Gemini /// public sealed partial class EmbedContentBatch { + /// + /// Stats about the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("batchStats")] + public global::Google.Gemini.EmbedContentBatchStats? BatchStats { get; set; } + /// /// Required. The user-defined name of this batch. /// @@ -15,25 +21,23 @@ public sealed partial class EmbedContentBatch public string? DisplayName { get; set; } /// - /// Output only. The state of the batch.
+ /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("state")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.EmbedContentBatchStateJsonConverter))] - public global::Google.Gemini.EmbedContentBatchState? State { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - public string? Model { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("output")] + public global::Google.Gemini.EmbedContentBatchOutput? Output { get; set; } /// - /// Output only. The time at which the batch was created.
- /// Included only in responses + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] - public string? CreateTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } /// /// Configures the input to the batch request. @@ -42,23 +46,17 @@ public sealed partial class EmbedContentBatch public global::Google.Gemini.InputEmbedContentConfig? InputConfig { get; set; } /// - /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. + /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// - [global::System.Text.Json.Serialization.JsonPropertyName("output")] - public global::Google.Gemini.EmbedContentBatchOutput? Output { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("priority")] + public string? Priority { get; set; } /// - /// Output only. The time at which the batch was last updated.
+ /// Output only. The time at which the batch was created.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] - public string? UpdateTime { get; set; } - - /// - /// Stats about the batch. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("batchStats")] - public global::Google.Gemini.EmbedContentBatchStats? BatchStats { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] + public string? CreateTime { get; set; } /// /// Output only. The time at which the batch processing completed.
@@ -68,17 +66,19 @@ public sealed partial class EmbedContentBatch public string? EndTime { get; set; } /// - /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. + /// Output only. The time at which the batch was last updated.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("priority")] - public string? Priority { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] + public string? UpdateTime { get; set; } /// - /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
+ /// Output only. The state of the batch.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.EmbedContentBatchStateJsonConverter))] + public global::Google.Gemini.EmbedContentBatchState? State { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -89,71 +89,71 @@ public sealed partial class EmbedContentBatch /// /// Initializes a new instance of the class. /// + /// + /// Stats about the batch. + /// /// /// Required. The user-defined name of this batch. /// - /// - /// Output only. The state of the batch.
+ /// + /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
/// Included only in responses /// + /// + /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. + /// /// /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. /// - /// - /// Output only. The time at which the batch was created.
- /// Included only in responses - /// /// /// Configures the input to the batch request. /// - /// - /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field. + /// + /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// - /// - /// Output only. The time at which the batch was last updated.
+ /// + /// Output only. The time at which the batch was created.
/// Included only in responses /// - /// - /// Stats about the batch. - /// /// /// Output only. The time at which the batch processing completed.
/// Included only in responses /// - /// - /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. + /// + /// Output only. The time at which the batch was last updated.
+ /// Included only in responses /// - /// - /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
+ /// + /// Output only. The state of the batch.
/// Included only in responses /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EmbedContentBatch( + global::Google.Gemini.EmbedContentBatchStats? batchStats, string? displayName, - global::Google.Gemini.EmbedContentBatchState? state, + string? name, + global::Google.Gemini.EmbedContentBatchOutput? output, string? model, - string? createTime, global::Google.Gemini.InputEmbedContentConfig? inputConfig, - global::Google.Gemini.EmbedContentBatchOutput? output, - string? updateTime, - global::Google.Gemini.EmbedContentBatchStats? batchStats, - string? endTime, string? priority, - string? name) + string? createTime, + string? endTime, + string? updateTime, + global::Google.Gemini.EmbedContentBatchState? state) { + this.BatchStats = batchStats; this.DisplayName = displayName; - this.State = state; + this.Name = name; + this.Output = output; this.Model = model; - this.CreateTime = createTime; this.InputConfig = inputConfig; - this.Output = output; - this.UpdateTime = updateTime; - this.BatchStats = batchStats; - this.EndTime = endTime; this.Priority = priority; - this.Name = name; + this.CreateTime = createTime; + this.EndTime = endTime; + this.UpdateTime = updateTime; + this.State = state; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchOutput.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchOutput.g.cs index 973d4848e..c7ac9b5f4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchOutput.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchOutput.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class EmbedContentBatchOutput { - /// - /// The responses to the requests in the batch. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inlinedResponses")] - public global::Google.Gemini.InlinedEmbedContentResponses? InlinedResponses { get; set; } - /// /// Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.
/// Included only in responses @@ -21,6 +15,12 @@ public sealed partial class EmbedContentBatchOutput [global::System.Text.Json.Serialization.JsonPropertyName("responsesFile")] public string? ResponsesFile { get; set; } + /// + /// The responses to the requests in the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("inlinedResponses")] + public global::Google.Gemini.InlinedEmbedContentResponses? InlinedResponses { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -30,22 +30,22 @@ public sealed partial class EmbedContentBatchOutput /// /// Initializes a new instance of the class. /// - /// - /// The responses to the requests in the batch. - /// /// /// Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.
/// Included only in responses /// + /// + /// The responses to the requests in the batch. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EmbedContentBatchOutput( - global::Google.Gemini.InlinedEmbedContentResponses? inlinedResponses, - string? responsesFile) + string? responsesFile, + global::Google.Gemini.InlinedEmbedContentResponses? inlinedResponses) { - this.InlinedResponses = inlinedResponses; this.ResponsesFile = responsesFile; + this.InlinedResponses = inlinedResponses; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchStats.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchStats.g.cs index 64a41a76a..4741eebf5 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchStats.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentBatchStats.g.cs @@ -9,11 +9,11 @@ namespace Google.Gemini public sealed partial class EmbedContentBatchStats { /// - /// Output only. The number of requests in the batch.
+ /// Output only. The number of requests that are still pending processing.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("requestCount")] - public string? RequestCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("pendingRequestCount")] + public string? PendingRequestCount { get; set; } /// /// Output only. The number of requests that were successfully processed.
@@ -23,11 +23,11 @@ public sealed partial class EmbedContentBatchStats public string? SuccessfulRequestCount { get; set; } /// - /// Output only. The number of requests that are still pending processing.
+ /// Output only. The number of requests in the batch.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("pendingRequestCount")] - public string? PendingRequestCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("requestCount")] + public string? RequestCount { get; set; } /// /// Output only. The number of requests that failed to be processed.
@@ -45,16 +45,16 @@ public sealed partial class EmbedContentBatchStats /// /// Initializes a new instance of the class. /// - /// - /// Output only. The number of requests in the batch.
+ /// + /// Output only. The number of requests that are still pending processing.
/// Included only in responses /// /// /// Output only. The number of requests that were successfully processed.
/// Included only in responses /// - /// - /// Output only. The number of requests that are still pending processing.
+ /// + /// Output only. The number of requests in the batch.
/// Included only in responses /// /// @@ -65,14 +65,14 @@ public sealed partial class EmbedContentBatchStats [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EmbedContentBatchStats( - string? requestCount, - string? successfulRequestCount, string? pendingRequestCount, + string? successfulRequestCount, + string? requestCount, string? failedRequestCount) { - this.RequestCount = requestCount; - this.SuccessfulRequestCount = successfulRequestCount; this.PendingRequestCount = pendingRequestCount; + this.SuccessfulRequestCount = successfulRequestCount; + this.RequestCount = requestCount; this.FailedRequestCount = failedRequestCount; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentConfig.g.cs index 87f846f3b..7b7fa2ddb 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentConfig.g.cs @@ -9,10 +9,10 @@ namespace Google.Gemini public sealed partial class EmbedContentConfig { /// - /// Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length. + /// Optional. Whether to enable OCR for document content. /// - [global::System.Text.Json.Serialization.JsonPropertyName("autoTruncate")] - public bool? AutoTruncate { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("documentOcr")] + public bool? DocumentOcr { get; set; } /// /// Optional. The title for the text. @@ -21,10 +21,11 @@ public sealed partial class EmbedContentConfig public string? Title { get; set; } /// - /// Optional. Whether to enable OCR for document content. + /// Optional. The task type of the embedding. /// - [global::System.Text.Json.Serialization.JsonPropertyName("documentOcr")] - public bool? DocumentOcr { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("taskType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.EmbedContentConfigTaskTypeJsonConverter))] + public global::Google.Gemini.EmbedContentConfigTaskType? TaskType { get; set; } /// /// Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. @@ -33,11 +34,10 @@ public sealed partial class EmbedContentConfig public int? OutputDimensionality { get; set; } /// - /// Optional. The task type of the embedding. + /// Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length. /// - [global::System.Text.Json.Serialization.JsonPropertyName("taskType")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.EmbedContentConfigTaskTypeJsonConverter))] - public global::Google.Gemini.EmbedContentConfigTaskType? TaskType { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("autoTruncate")] + public bool? AutoTruncate { get; set; } /// /// Optional. Whether to extract audio from video content. @@ -54,20 +54,20 @@ public sealed partial class EmbedContentConfig /// /// Initializes a new instance of the class. /// - /// - /// Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length. + /// + /// Optional. Whether to enable OCR for document content. /// /// /// Optional. The title for the text. /// - /// - /// Optional. Whether to enable OCR for document content. + /// + /// Optional. The task type of the embedding. /// /// /// Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. /// - /// - /// Optional. The task type of the embedding. + /// + /// Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length. /// /// /// Optional. Whether to extract audio from video content. @@ -76,18 +76,18 @@ public sealed partial class EmbedContentConfig [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EmbedContentConfig( - bool? autoTruncate, - string? title, bool? documentOcr, - int? outputDimensionality, + string? title, global::Google.Gemini.EmbedContentConfigTaskType? taskType, + int? outputDimensionality, + bool? autoTruncate, bool? audioTrackExtraction) { - this.AutoTruncate = autoTruncate; - this.Title = title; this.DocumentOcr = documentOcr; - this.OutputDimensionality = outputDimensionality; + this.Title = title; this.TaskType = taskType; + this.OutputDimensionality = outputDimensionality; + this.AutoTruncate = autoTruncate; this.AudioTrackExtraction = audioTrackExtraction; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentRequest.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentRequest.g.cs index c338a16f6..d2f3aa00d 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentRequest.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.EmbedContentRequest.g.cs @@ -10,6 +10,12 @@ namespace Google.Gemini /// public sealed partial class EmbedContentRequest { + /// + /// Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}` + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + /// /// Optional. Deprecated: Please use EmbedContentConfig.title instead. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval. /// @@ -18,10 +24,10 @@ public sealed partial class EmbedContentRequest public string? Title { get; set; } /// - /// Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}` + /// Configurations for the EmbedContent request. /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - public string? Model { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("embedContentConfig")] + public global::Google.Gemini.EmbedContentConfig? EmbedContentConfig { get; set; } /// /// Optional. Deprecated: Please use EmbedContentConfig.task_type instead. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`). @@ -32,10 +38,11 @@ public sealed partial class EmbedContentRequest public global::Google.Gemini.EmbedContentRequestTaskType? TaskType { get; set; } /// - /// Configurations for the EmbedContent request. + /// Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`). /// - [global::System.Text.Json.Serialization.JsonPropertyName("embedContentConfig")] - public global::Google.Gemini.EmbedContentConfig? EmbedContentConfig { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("outputDimensionality")] + [global::System.Obsolete("This property marked as deprecated.")] + public int? OutputDimensionality { get; set; } /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. @@ -43,13 +50,6 @@ public sealed partial class EmbedContentRequest [global::System.Text.Json.Serialization.JsonPropertyName("content")] public global::Google.Gemini.Content? Content { get; set; } - /// - /// Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("outputDimensionality")] - [global::System.Obsolete("This property marked as deprecated.")] - public int? OutputDimensionality { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ExecutableCode.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ExecutableCode.g.cs index 4f2c65f29..ab199b5fc 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ExecutableCode.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ExecutableCode.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class ExecutableCode { - /// - /// Required. The code to be executed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("code")] - public string? Code { get; set; } - /// /// Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`. /// [global::System.Text.Json.Serialization.JsonPropertyName("id")] public string? Id { get; set; } + /// + /// Required. The code to be executed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + public string? Code { get; set; } + /// /// Required. Programming language of the `code`. /// @@ -36,12 +36,12 @@ public sealed partial class ExecutableCode /// /// Initializes a new instance of the class. /// - /// - /// Required. The code to be executed. - /// /// /// Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`. /// + /// + /// Required. The code to be executed. + /// /// /// Required. Programming language of the `code`. /// @@ -49,12 +49,12 @@ public sealed partial class ExecutableCode [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ExecutableCode( - string? code, string? id, + string? code, global::Google.Gemini.ExecutableCodeLanguage? language) { - this.Code = code; this.Id = id; + this.Code = code; this.Language = language; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.File.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.File.g.cs index 029285989..42a711e1b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.File.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.File.g.cs @@ -8,25 +8,6 @@ namespace Google.Gemini /// public sealed partial class File { - /// - /// Metadata for a video `File`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("videoMetadata")] - public global::Google.Gemini.VideoFileMetadata? VideoMetadata { get; set; } - - /// - /// Output only. The timestamp of when the `File` was last updated.
- /// Included only in responses - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] - public string? UpdateTime { get; set; } - - /// - /// Immutable. Identifier. The `File` resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456` - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } - /// /// Output only. Size of the file in bytes.
/// Included only in responses @@ -35,11 +16,11 @@ public sealed partial class File public string? SizeBytes { get; set; } /// - /// Output only. SHA-256 hash of the uploaded bytes.
+ /// Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("sha256Hash")] - public byte[]? Sha256Hash { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("expirationTime")] + public string? ExpirationTime { get; set; } /// /// Output only. The download uri of the `File`.
@@ -49,11 +30,23 @@ public sealed partial class File public string? DownloadUri { get; set; } /// - /// Output only. MIME type of the file.
+ /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::Google.Gemini.Status? Error { get; set; } + + /// + /// Immutable. Identifier. The `File` resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456` + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Output only. SHA-256 hash of the uploaded bytes.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("mimeType")] - public string? MimeType { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("sha256Hash")] + public byte[]? Sha256Hash { get; set; } /// /// Source of the File. @@ -63,24 +56,26 @@ public sealed partial class File public global::Google.Gemini.FileSource? Source { get; set; } /// - /// Output only. Processing state of the File.
+ /// Output only. The timestamp of when the `File` was created.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("state")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.FileStateJsonConverter))] - public global::Google.Gemini.FileState? State { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] + public string? CreateTime { get; set; } /// - /// Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image" + /// Output only. The timestamp of when the `File` was last updated.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] - public string? DisplayName { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] + public string? UpdateTime { get; set; } /// - /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// Output only. Processing state of the File.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public global::Google.Gemini.Status? Error { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.FileStateJsonConverter))] + public global::Google.Gemini.FileState? State { get; set; } /// /// Output only. The uri of the `File`.
@@ -90,18 +85,23 @@ public sealed partial class File public string? Uri { get; set; } /// - /// Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.
- /// Included only in responses + /// Metadata for a video `File`. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("expirationTime")] - public string? ExpirationTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("videoMetadata")] + public global::Google.Gemini.VideoFileMetadata? VideoMetadata { get; set; } /// - /// Output only. The timestamp of when the `File` was created.
+ /// Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image" + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// + /// Output only. MIME type of the file.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] - public string? CreateTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("mimeType")] + public string? MimeType { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -112,90 +112,90 @@ public sealed partial class File /// /// Initializes a new instance of the class. /// - /// - /// Metadata for a video `File`. - /// - /// - /// Output only. The timestamp of when the `File` was last updated.
- /// Included only in responses - /// - /// - /// Immutable. Identifier. The `File` resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456` - /// /// /// Output only. Size of the file in bytes.
/// Included only in responses /// - /// - /// Output only. SHA-256 hash of the uploaded bytes.
+ /// + /// Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.
/// Included only in responses /// /// /// Output only. The download uri of the `File`.
/// Included only in responses /// - /// - /// Output only. MIME type of the file.
+ /// + /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// + /// + /// Immutable. Identifier. The `File` resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456` + /// + /// + /// Output only. SHA-256 hash of the uploaded bytes.
/// Included only in responses /// /// /// Source of the File. /// - /// - /// Output only. Processing state of the File.
+ /// + /// Output only. The timestamp of when the `File` was created.
/// Included only in responses /// - /// - /// Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image" + /// + /// Output only. The timestamp of when the `File` was last updated.
+ /// Included only in responses /// - /// - /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// + /// Output only. Processing state of the File.
+ /// Included only in responses /// /// /// Output only. The uri of the `File`.
/// Included only in responses /// - /// - /// Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.
- /// Included only in responses + /// + /// Metadata for a video `File`. /// - /// - /// Output only. The timestamp of when the `File` was created.
+ /// + /// Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image" + /// + /// + /// Output only. MIME type of the file.
/// Included only in responses /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public File( - global::Google.Gemini.VideoFileMetadata? videoMetadata, - string? updateTime, - string? name, string? sizeBytes, - byte[]? sha256Hash, + string? expirationTime, string? downloadUri, - string? mimeType, + global::Google.Gemini.Status? error, + string? name, + byte[]? sha256Hash, global::Google.Gemini.FileSource? source, + string? createTime, + string? updateTime, global::Google.Gemini.FileState? state, - string? displayName, - global::Google.Gemini.Status? error, string? uri, - string? expirationTime, - string? createTime) + global::Google.Gemini.VideoFileMetadata? videoMetadata, + string? displayName, + string? mimeType) { - this.VideoMetadata = videoMetadata; - this.UpdateTime = updateTime; - this.Name = name; this.SizeBytes = sizeBytes; - this.Sha256Hash = sha256Hash; + this.ExpirationTime = expirationTime; this.DownloadUri = downloadUri; - this.MimeType = mimeType; + this.Error = error; + this.Name = name; + this.Sha256Hash = sha256Hash; this.Source = source; + this.CreateTime = createTime; + this.UpdateTime = updateTime; this.State = state; - this.DisplayName = displayName; - this.Error = error; this.Uri = uri; - this.ExpirationTime = expirationTime; - this.CreateTime = createTime; + this.VideoMetadata = videoMetadata; + this.DisplayName = displayName; + this.MimeType = mimeType; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearch.g.cs index c1f5a4046..c4b535893 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearch.g.cs @@ -8,6 +8,12 @@ namespace Google.Gemini /// public sealed partial class FileSearch { + /// + /// Optional. Metadata filter to apply to the semantic retrieval documents and chunks. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metadataFilter")] + public string? MetadataFilter { get; set; } + /// /// Optional. The number of semantic retrieval chunks to retrieve. /// @@ -20,12 +26,6 @@ public sealed partial class FileSearch [global::System.Text.Json.Serialization.JsonPropertyName("fileSearchStoreNames")] public global::System.Collections.Generic.IList? FileSearchStoreNames { get; set; } - /// - /// Optional. Metadata filter to apply to the semantic retrieval documents and chunks. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadataFilter")] - public string? MetadataFilter { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -35,26 +35,26 @@ public sealed partial class FileSearch /// /// Initializes a new instance of the class. /// + /// + /// Optional. Metadata filter to apply to the semantic retrieval documents and chunks. + /// /// /// Optional. The number of semantic retrieval chunks to retrieve. /// /// /// Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123` /// - /// - /// Optional. Metadata filter to apply to the semantic retrieval documents and chunks. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public FileSearch( + string? metadataFilter, int? topK, - global::System.Collections.Generic.IList? fileSearchStoreNames, - string? metadataFilter) + global::System.Collections.Generic.IList? fileSearchStoreNames) { + this.MetadataFilter = metadataFilter; this.TopK = topK; this.FileSearchStoreNames = fileSearchStoreNames; - this.MetadataFilter = metadataFilter; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearchStore.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearchStore.g.cs index cddd85a45..f30229763 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearchStore.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FileSearchStore.g.cs @@ -16,44 +16,44 @@ public sealed partial class FileSearchStore public string? CreateTime { get; set; } /// - /// Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" + /// Output only. The Timestamp of when the `FileSearchStore` was last updated.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] - public string? DisplayName { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] + public string? UpdateTime { get; set; } /// - /// Output only. The number of documents in the `FileSearchStore` that are being processed.
+ /// Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("pendingDocumentsCount")] - public string? PendingDocumentsCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("sizeBytes")] + public string? SizeBytes { get; set; } /// - /// Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used. + /// Output only. The number of documents in the `FileSearchStore` that have failed processing.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("embeddingModel")] - public string? EmbeddingModel { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("failedDocumentsCount")] + public string? FailedDocumentsCount { get; set; } /// - /// Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`.
- /// Included only in responses + /// Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" ///
- [global::System.Text.Json.Serialization.JsonPropertyName("sizeBytes")] - public string? SizeBytes { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } /// - /// Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the "fileSearchStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.
- /// Included only in responses + /// Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("embeddingModel")] + public string? EmbeddingModel { get; set; } /// - /// Output only. The Timestamp of when the `FileSearchStore` was last updated.
+ /// Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the "fileSearchStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] - public string? UpdateTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } /// /// Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval.
@@ -63,11 +63,11 @@ public sealed partial class FileSearchStore public string? ActiveDocumentsCount { get; set; } /// - /// Output only. The number of documents in the `FileSearchStore` that have failed processing.
+ /// Output only. The number of documents in the `FileSearchStore` that are being processed.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("failedDocumentsCount")] - public string? FailedDocumentsCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("pendingDocumentsCount")] + public string? PendingDocumentsCount { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -82,34 +82,34 @@ public sealed partial class FileSearchStore /// Output only. The Timestamp of when the `FileSearchStore` was created.
/// Included only in responses /// - /// - /// Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" - /// - /// - /// Output only. The number of documents in the `FileSearchStore` that are being processed.
+ /// + /// Output only. The Timestamp of when the `FileSearchStore` was last updated.
/// Included only in responses /// - /// - /// Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used. - /// /// /// Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`.
/// Included only in responses /// - /// - /// Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the "fileSearchStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.
+ /// + /// Output only. The number of documents in the `FileSearchStore` that have failed processing.
/// Included only in responses /// - /// - /// Output only. The Timestamp of when the `FileSearchStore` was last updated.
+ /// + /// Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever" + /// + /// + /// Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used. + /// + /// + /// Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the "fileSearchStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.
/// Included only in responses /// /// /// Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval.
/// Included only in responses /// - /// - /// Output only. The number of documents in the `FileSearchStore` that have failed processing.
+ /// + /// Output only. The number of documents in the `FileSearchStore` that are being processed.
/// Included only in responses /// #if NET7_0_OR_GREATER @@ -117,24 +117,24 @@ public sealed partial class FileSearchStore #endif public FileSearchStore( string? createTime, + string? updateTime, + string? sizeBytes, + string? failedDocumentsCount, string? displayName, - string? pendingDocumentsCount, string? embeddingModel, - string? sizeBytes, string? name, - string? updateTime, string? activeDocumentsCount, - string? failedDocumentsCount) + string? pendingDocumentsCount) { this.CreateTime = createTime; + this.UpdateTime = updateTime; + this.SizeBytes = sizeBytes; + this.FailedDocumentsCount = failedDocumentsCount; this.DisplayName = displayName; - this.PendingDocumentsCount = pendingDocumentsCount; this.EmbeddingModel = embeddingModel; - this.SizeBytes = sizeBytes; this.Name = name; - this.UpdateTime = updateTime; this.ActiveDocumentsCount = activeDocumentsCount; - this.FailedDocumentsCount = failedDocumentsCount; + this.PendingDocumentsCount = pendingDocumentsCount; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCall.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCall.g.cs index e2ad38ad2..310f34cc6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCall.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCall.g.cs @@ -14,18 +14,18 @@ public sealed partial class FunctionCall [global::System.Text.Json.Serialization.JsonPropertyName("name")] public string? Name { get; set; } - /// - /// Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - public string? Id { get; set; } - /// /// Optional. The function parameters and values in JSON object format. /// [global::System.Text.Json.Serialization.JsonPropertyName("args")] public object? Args { get; set; } + /// + /// Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -38,23 +38,23 @@ public sealed partial class FunctionCall /// /// Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128. /// - /// - /// Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. - /// /// /// Optional. The function parameters and values in JSON object format. /// + /// + /// Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public FunctionCall( string? name, - string? id, - object? args) + object? args, + string? id) { this.Name = name; - this.Id = id; this.Args = args; + this.Id = id; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCallingConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCallingConfig.g.cs index 34bb1ab5c..4f2fd7633 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCallingConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionCallingConfig.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class FunctionCallingConfig { - /// - /// Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("allowedFunctionNames")] - public global::System.Collections.Generic.IList? AllowedFunctionNames { get; set; } - /// /// Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO. /// @@ -21,6 +15,12 @@ public sealed partial class FunctionCallingConfig [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.FunctionCallingConfigModeJsonConverter))] public global::Google.Gemini.FunctionCallingConfigMode? Mode { get; set; } + /// + /// Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("allowedFunctionNames")] + public global::System.Collections.Generic.IList? AllowedFunctionNames { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -30,21 +30,21 @@ public sealed partial class FunctionCallingConfig /// /// Initializes a new instance of the class. /// - /// - /// Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names. - /// /// /// Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO. /// + /// + /// Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public FunctionCallingConfig( - global::System.Collections.Generic.IList? allowedFunctionNames, - global::Google.Gemini.FunctionCallingConfigMode? mode) + global::Google.Gemini.FunctionCallingConfigMode? mode, + global::System.Collections.Generic.IList? allowedFunctionNames) { - this.AllowedFunctionNames = allowedFunctionNames; this.Mode = mode; + this.AllowedFunctionNames = allowedFunctionNames; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionDeclaration.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionDeclaration.g.cs index 37feaecca..52203c3b3 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionDeclaration.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionDeclaration.g.cs @@ -9,16 +9,10 @@ namespace Google.Gemini public sealed partial class FunctionDeclaration { /// - /// Required. A brief description of the function. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`. + /// Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128. /// - [global::System.Text.Json.Serialization.JsonPropertyName("parametersJsonSchema")] - public object? ParametersJsonSchema { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } /// /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). @@ -26,12 +20,6 @@ public sealed partial class FunctionDeclaration [global::System.Text.Json.Serialization.JsonPropertyName("response")] public global::Google.Gemini.Schema? Response { get; set; } - /// - /// Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } - /// /// Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. /// @@ -39,6 +27,18 @@ public sealed partial class FunctionDeclaration [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.FunctionDeclarationBehaviorJsonConverter))] public global::Google.Gemini.FunctionDeclarationBehavior? Behavior { get; set; } + /// + /// Required. A brief description of the function. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("parametersJsonSchema")] + public object? ParametersJsonSchema { get; set; } + /// /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). /// @@ -60,21 +60,21 @@ public sealed partial class FunctionDeclaration /// /// Initializes a new instance of the class. /// - /// - /// Required. A brief description of the function. - /// - /// - /// Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`. + /// + /// Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128. /// /// /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). /// - /// - /// Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128. - /// /// /// Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. /// + /// + /// Required. A brief description of the function. + /// + /// + /// Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`. + /// /// /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). /// @@ -85,19 +85,19 @@ public sealed partial class FunctionDeclaration [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public FunctionDeclaration( - string? description, - object? parametersJsonSchema, - global::Google.Gemini.Schema? response, string? name, + global::Google.Gemini.Schema? response, global::Google.Gemini.FunctionDeclarationBehavior? behavior, + string? description, + object? parametersJsonSchema, global::Google.Gemini.Schema? parameters, object? responseJsonSchema) { - this.Description = description; - this.ParametersJsonSchema = parametersJsonSchema; - this.Response = response; this.Name = name; + this.Response = response; this.Behavior = behavior; + this.Description = description; + this.ParametersJsonSchema = parametersJsonSchema; this.Parameters = parameters; this.ResponseJsonSchema = responseJsonSchema; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionResponse.g.cs index a002ed647..095312266 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.FunctionResponse.g.cs @@ -8,6 +8,24 @@ namespace Google.Gemini /// public sealed partial class FunctionResponse { + /// + /// Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("response")] + public object? Response { get; set; } + + /// + /// Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + /// /// Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`. /// @@ -27,24 +45,6 @@ public sealed partial class FunctionResponse [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.FunctionResponseSchedulingJsonConverter))] public global::Google.Gemini.FunctionResponseScheduling? Scheduling { get; set; } - /// - /// Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response")] - public object? Response { get; set; } - - /// - /// Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -54,6 +54,15 @@ public sealed partial class FunctionResponse /// /// Initializes a new instance of the class. /// + /// + /// Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128. + /// + /// + /// Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model. + /// + /// + /// Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`. + /// /// /// Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`. /// @@ -63,32 +72,23 @@ public sealed partial class FunctionResponse /// /// Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. /// - /// - /// Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`. - /// - /// - /// Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model. - /// - /// - /// Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public FunctionResponse( + string? name, + object? response, + string? id, bool? willContinue, global::System.Collections.Generic.IList? parts, - global::Google.Gemini.FunctionResponseScheduling? scheduling, - string? id, - object? response, - string? name) + global::Google.Gemini.FunctionResponseScheduling? scheduling) { + this.Name = name; + this.Response = response; + this.Id = id; this.WillContinue = willContinue; this.Parts = parts; this.Scheduling = scheduling; - this.Id = id; - this.Response = response; - this.Name = name; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatch.g.cs index ff406ac63..06edd8cdb 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatch.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatch.g.cs @@ -14,13 +14,6 @@ public sealed partial class GenerateContentBatch [global::System.Text.Json.Serialization.JsonPropertyName("model")] public string? Model { get; set; } - /// - /// Output only. The time at which the batch was created.
- /// Included only in responses - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] - public string? CreateTime { get; set; } - /// /// Configures the input to the batch request. /// @@ -28,24 +21,17 @@ public sealed partial class GenerateContentBatch public global::Google.Gemini.InputConfig? InputConfig { get; set; } /// - /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("output")] - public global::Google.Gemini.GenerateContentBatchOutput? Output { get; set; } - - /// - /// Required. The user-defined name of this batch. + /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// - [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] - public string? DisplayName { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("priority")] + public string? Priority { get; set; } /// - /// Output only. The state of the batch.
+ /// Output only. The time at which the batch was created.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("state")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.GenerateContentBatchStateJsonConverter))] - public global::Google.Gemini.GenerateContentBatchState? State { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] + public string? CreateTime { get; set; } /// /// Output only. The time at which the batch processing completed.
@@ -55,17 +41,19 @@ public sealed partial class GenerateContentBatch public string? EndTime { get; set; } /// - /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. + /// Output only. The time at which the batch was last updated.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("priority")] - public string? Priority { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] + public string? UpdateTime { get; set; } /// - /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
+ /// Output only. The state of the batch.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.GenerateContentBatchStateJsonConverter))] + public global::Google.Gemini.GenerateContentBatchState? State { get; set; } /// /// Stats about the batch. @@ -74,11 +62,23 @@ public sealed partial class GenerateContentBatch public global::Google.Gemini.BatchStats? BatchStats { get; set; } /// - /// Output only. The time at which the batch was last updated.
+ /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] - public string? UpdateTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output")] + public global::Google.Gemini.GenerateContentBatchOutput? Output { get; set; } + + /// + /// Required. The user-defined name of this batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -92,68 +92,68 @@ public sealed partial class GenerateContentBatch /// /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. /// - /// - /// Output only. The time at which the batch was created.
- /// Included only in responses - /// /// /// Configures the input to the batch request. /// - /// - /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. - /// - /// - /// Required. The user-defined name of this batch. + /// + /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. /// - /// - /// Output only. The state of the batch.
+ /// + /// Output only. The time at which the batch was created.
/// Included only in responses /// /// /// Output only. The time at which the batch processing completed.
/// Included only in responses /// - /// - /// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0. + /// + /// Output only. The time at which the batch was last updated.
+ /// Included only in responses /// - /// - /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
+ /// + /// Output only. The state of the batch.
/// Included only in responses /// /// /// Stats about the batch. /// - /// - /// Output only. The time at which the batch was last updated.
+ /// + /// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
/// Included only in responses /// + /// + /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field. + /// + /// + /// Required. The user-defined name of this batch. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GenerateContentBatch( string? model, - string? createTime, global::Google.Gemini.InputConfig? inputConfig, - global::Google.Gemini.GenerateContentBatchOutput? output, - string? displayName, - global::Google.Gemini.GenerateContentBatchState? state, - string? endTime, string? priority, - string? name, + string? createTime, + string? endTime, + string? updateTime, + global::Google.Gemini.GenerateContentBatchState? state, global::Google.Gemini.BatchStats? batchStats, - string? updateTime) + string? name, + global::Google.Gemini.GenerateContentBatchOutput? output, + string? displayName) { this.Model = model; - this.CreateTime = createTime; this.InputConfig = inputConfig; - this.Output = output; - this.DisplayName = displayName; - this.State = state; - this.EndTime = endTime; this.Priority = priority; - this.Name = name; - this.BatchStats = batchStats; + this.CreateTime = createTime; + this.EndTime = endTime; this.UpdateTime = updateTime; + this.State = state; + this.BatchStats = batchStats; + this.Name = name; + this.Output = output; + this.DisplayName = displayName; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatchOutput.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatchOutput.g.cs index 12a631bfb..ca3508f3a 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatchOutput.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentBatchOutput.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class GenerateContentBatchOutput { - /// - /// The responses to the requests in the batch. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inlinedResponses")] - public global::Google.Gemini.InlinedResponses? InlinedResponses { get; set; } - /// /// Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.
/// Included only in responses @@ -21,6 +15,12 @@ public sealed partial class GenerateContentBatchOutput [global::System.Text.Json.Serialization.JsonPropertyName("responsesFile")] public string? ResponsesFile { get; set; } + /// + /// The responses to the requests in the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("inlinedResponses")] + public global::Google.Gemini.InlinedResponses? InlinedResponses { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -30,22 +30,22 @@ public sealed partial class GenerateContentBatchOutput /// /// Initializes a new instance of the class. /// - /// - /// The responses to the requests in the batch. - /// /// /// Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.
/// Included only in responses /// + /// + /// The responses to the requests in the batch. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GenerateContentBatchOutput( - global::Google.Gemini.InlinedResponses? inlinedResponses, - string? responsesFile) + string? responsesFile, + global::Google.Gemini.InlinedResponses? inlinedResponses) { - this.InlinedResponses = inlinedResponses; this.ResponsesFile = responsesFile; + this.InlinedResponses = inlinedResponses; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentRequest.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentRequest.g.cs index 8297f991d..a02e8dfbc 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentRequest.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentRequest.g.cs @@ -9,22 +9,23 @@ namespace Google.Gemini public sealed partial class GenerateContentRequest { /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - [global::System.Text.Json.Serialization.JsonPropertyName("contents")] - public global::System.Collections.Generic.IList? Contents { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("generationConfig")] + public global::Google.Gemini.GenerationConfig? GenerationConfig { get; set; } /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - [global::System.Text.Json.Serialization.JsonPropertyName("toolConfig")] - public global::Google.Gemini.ToolConfig? ToolConfig { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("tools")] + public global::System.Collections.Generic.IList? Tools { get; set; } /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// Optional. The service tier of the request. /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - public string? Model { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("serviceTier")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.GenerateContentRequestServiceTierJsonConverter))] + public global::Google.Gemini.GenerateContentRequestServiceTier? ServiceTier { get; set; } /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. @@ -33,41 +34,40 @@ public sealed partial class GenerateContentRequest public global::Google.Gemini.Content? SystemInstruction { get; set; } /// - /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` + /// The Tool configuration containing parameters for specifying `Tool` use in the request. /// - [global::System.Text.Json.Serialization.JsonPropertyName("cachedContent")] - public string? CachedContent { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("toolConfig")] + public global::Google.Gemini.ToolConfig? ToolConfig { get; set; } /// - /// Optional. The service tier of the request. + /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - [global::System.Text.Json.Serialization.JsonPropertyName("serviceTier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.GenerateContentRequestServiceTierJsonConverter))] - public global::Google.Gemini.GenerateContentRequestServiceTier? ServiceTier { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("cachedContent")] + public string? CachedContent { get; set; } /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - [global::System.Text.Json.Serialization.JsonPropertyName("tools")] - public global::System.Collections.Generic.IList? Tools { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("store")] + public bool? Store { get; set; } /// - /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. /// - [global::System.Text.Json.Serialization.JsonPropertyName("safetySettings")] - public global::System.Collections.Generic.IList? SafetySettings { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// - [global::System.Text.Json.Serialization.JsonPropertyName("generationConfig")] - public global::Google.Gemini.GenerationConfig? GenerationConfig { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("contents")] + public global::System.Collections.Generic.IList? Contents { get; set; } /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. + /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - [global::System.Text.Json.Serialization.JsonPropertyName("store")] - public bool? Store { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("safetySettings")] + public global::System.Collections.Generic.IList? SafetySettings { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -78,61 +78,61 @@ public sealed partial class GenerateContentRequest /// /// Initializes a new instance of the class. /// - /// - /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. + /// + /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. /// - /// - /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// + /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. /// - /// - /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// Optional. The service tier of the request. /// /// /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. /// + /// + /// The Tool configuration containing parameters for specifying `Tool` use in the request. + /// /// /// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}` /// - /// - /// Optional. The service tier of the request. + /// + /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. /// - /// - /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more. + /// + /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`. + /// + /// + /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request. /// /// /// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications. /// - /// - /// Configuration options for model generation and outputs. Not all parameters are configurable for every model. - /// - /// - /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GenerateContentRequest( - global::System.Collections.Generic.IList? contents, - global::Google.Gemini.ToolConfig? toolConfig, - string? model, + global::Google.Gemini.GenerationConfig? generationConfig, + global::System.Collections.Generic.IList? tools, + global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier, global::Google.Gemini.Content? systemInstruction, + global::Google.Gemini.ToolConfig? toolConfig, string? cachedContent, - global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier, - global::System.Collections.Generic.IList? tools, - global::System.Collections.Generic.IList? safetySettings, - global::Google.Gemini.GenerationConfig? generationConfig, - bool? store) + bool? store, + string? model, + global::System.Collections.Generic.IList? contents, + global::System.Collections.Generic.IList? safetySettings) { - this.Contents = contents; - this.ToolConfig = toolConfig; - this.Model = model; + this.GenerationConfig = generationConfig; + this.Tools = tools; + this.ServiceTier = serviceTier; this.SystemInstruction = systemInstruction; + this.ToolConfig = toolConfig; this.CachedContent = cachedContent; - this.ServiceTier = serviceTier; - this.Tools = tools; - this.SafetySettings = safetySettings; - this.GenerationConfig = generationConfig; this.Store = store; + this.Model = model; + this.Contents = contents; + this.SafetySettings = safetySettings; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentResponse.g.cs index 372941368..c7ff424ee 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerateContentResponse.g.cs @@ -9,16 +9,17 @@ namespace Google.Gemini public sealed partial class GenerateContentResponse { /// - /// The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable. + /// Output only. The model version used to generate the response.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("modelStatus")] - public global::Google.Gemini.ModelStatus? ModelStatus { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("modelVersion")] + public string? ModelVersion { get; set; } /// - /// Candidate responses from the model. + /// A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`. /// - [global::System.Text.Json.Serialization.JsonPropertyName("candidates")] - public global::System.Collections.Generic.IList? Candidates { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("promptFeedback")] + public global::Google.Gemini.PromptFeedback? PromptFeedback { get; set; } /// /// Output only. response_id is used to identify each response.
@@ -28,17 +29,10 @@ public sealed partial class GenerateContentResponse public string? ResponseId { get; set; } /// - /// A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("promptFeedback")] - public global::Google.Gemini.PromptFeedback? PromptFeedback { get; set; } - - /// - /// Output only. The model version used to generate the response.
- /// Included only in responses + /// Candidate responses from the model. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("modelVersion")] - public string? ModelVersion { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("candidates")] + public global::System.Collections.Generic.IList? Candidates { get; set; } /// /// Metadata on the generation request's token usage. @@ -46,6 +40,12 @@ public sealed partial class GenerateContentResponse [global::System.Text.Json.Serialization.JsonPropertyName("usageMetadata")] public global::Google.Gemini.UsageMetadata? UsageMetadata { get; set; } + /// + /// The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelStatus")] + public global::Google.Gemini.ModelStatus? ModelStatus { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -55,43 +55,43 @@ public sealed partial class GenerateContentResponse /// /// Initializes a new instance of the class. /// - /// - /// The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable. - /// - /// - /// Candidate responses from the model. - /// - /// - /// Output only. response_id is used to identify each response.
+ /// + /// Output only. The model version used to generate the response.
/// Included only in responses /// /// /// A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`. /// - /// - /// Output only. The model version used to generate the response.
+ /// + /// Output only. response_id is used to identify each response.
/// Included only in responses /// + /// + /// Candidate responses from the model. + /// /// /// Metadata on the generation request's token usage. /// + /// + /// The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GenerateContentResponse( - global::Google.Gemini.ModelStatus? modelStatus, - global::System.Collections.Generic.IList? candidates, - string? responseId, - global::Google.Gemini.PromptFeedback? promptFeedback, string? modelVersion, - global::Google.Gemini.UsageMetadata? usageMetadata) + global::Google.Gemini.PromptFeedback? promptFeedback, + string? responseId, + global::System.Collections.Generic.IList? candidates, + global::Google.Gemini.UsageMetadata? usageMetadata, + global::Google.Gemini.ModelStatus? modelStatus) { - this.ModelStatus = modelStatus; - this.Candidates = candidates; - this.ResponseId = responseId; - this.PromptFeedback = promptFeedback; this.ModelVersion = modelVersion; + this.PromptFeedback = promptFeedback; + this.ResponseId = responseId; + this.Candidates = candidates; this.UsageMetadata = usageMetadata; + this.ModelStatus = modelStatus; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GeneratedFile.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GeneratedFile.g.cs index f270d8490..785143aa1 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GeneratedFile.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GeneratedFile.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class GeneratedFile { - /// - /// Identifier. The name of the generated file. Example: `generatedFiles/abc-123` - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } - /// /// MIME type of the generatedFile. /// @@ -34,6 +28,12 @@ public sealed partial class GeneratedFile [global::System.Text.Json.Serialization.JsonPropertyName("error")] public global::Google.Gemini.Status? Error { get; set; } + /// + /// Identifier. The name of the generated file. Example: `generatedFiles/abc-123` + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -43,9 +43,6 @@ public sealed partial class GeneratedFile /// /// Initializes a new instance of the class. /// - /// - /// Identifier. The name of the generated file. Example: `generatedFiles/abc-123` - /// /// /// MIME type of the generatedFile. /// @@ -56,19 +53,22 @@ public sealed partial class GeneratedFile /// /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). /// + /// + /// Identifier. The name of the generated file. Example: `generatedFiles/abc-123` + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GeneratedFile( - string? name, string? mimeType, global::Google.Gemini.GeneratedFileState? state, - global::Google.Gemini.Status? error) + global::Google.Gemini.Status? error, + string? name) { - this.Name = name; this.MimeType = mimeType; this.State = state; this.Error = error; + this.Name = name; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerationConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerationConfig.g.cs index d07f7f4cf..b48824e06 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerationConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GenerationConfig.g.cs @@ -9,11 +9,10 @@ namespace Google.Gemini public sealed partial class GenerationConfig { /// - /// Optional. If specified, the media resolution specified will be used. + /// Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit. /// - [global::System.Text.Json.Serialization.JsonPropertyName("mediaResolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.GenerationConfigMediaResolutionJsonConverter))] - public global::Google.Gemini.GenerationConfigMediaResolution? MediaResolution { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("frequencyPenalty")] + public float? FrequencyPenalty { get; set; } /// /// Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests. @@ -22,10 +21,10 @@ public sealed partial class GenerationConfig public float? TopP { get; set; } /// - /// Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests. + /// Optional. Enables enhanced civic answers. It may not be available for all models. /// - [global::System.Text.Json.Serialization.JsonPropertyName("topK")] - public int? TopK { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("enableEnhancedCivicAnswers")] + public bool? EnableEnhancedCivicAnswers { get; set; } /// /// Config for image generation features. @@ -33,6 +32,12 @@ public sealed partial class GenerationConfig [global::System.Text.Json.Serialization.JsonPropertyName("imageConfig")] public global::Google.Gemini.ImageConfig? ImageConfig { get; set; } + /// + /// Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("presencePenalty")] + public float? PresencePenalty { get; set; } + /// /// Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function. /// @@ -40,16 +45,22 @@ public sealed partial class GenerationConfig public int? MaxOutputTokens { get; set; } /// - /// Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]. + /// Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types. /// - [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("responseMimeType")] + public string? ResponseMimeType { get; set; } /// - /// Optional. An internal detail. Use `responseJsonSchema` rather than this field. + /// Optional. Seed used in decoding. If not set, the request uses a randomly generated seed. /// - [global::System.Text.Json.Serialization.JsonPropertyName("responseJsonSchema")] - public object? ResponseJsonSchema { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("responseSchema")] + public global::Google.Gemini.Schema? ResponseSchema { get; set; } /// /// Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20]. @@ -58,28 +69,28 @@ public sealed partial class GenerationConfig public int? Logprobs { get; set; } /// - /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). + /// Optional. An internal detail. Use `responseJsonSchema` rather than this field. /// - [global::System.Text.Json.Serialization.JsonPropertyName("responseSchema")] - public global::Google.Gemini.Schema? ResponseSchema { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("responseJsonSchema")] + public object? ResponseJsonSchema { get; set; } /// - /// Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary. + /// Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family) /// - [global::System.Text.Json.Serialization.JsonPropertyName("presencePenalty")] - public float? PresencePenalty { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("candidateCount")] + public int? CandidateCount { get; set; } /// - /// Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response. + /// Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests. /// - [global::System.Text.Json.Serialization.JsonPropertyName("stopSequences")] - public global::System.Collections.Generic.IList? StopSequences { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("topK")] + public int? TopK { get; set; } /// - /// Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types. + /// Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response. /// - [global::System.Text.Json.Serialization.JsonPropertyName("responseMimeType")] - public string? ResponseMimeType { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("stopSequences")] + public global::System.Collections.Generic.IList? StopSequences { get; set; } /// /// Optional. If true, export the logprobs results in response. @@ -87,12 +98,6 @@ public sealed partial class GenerationConfig [global::System.Text.Json.Serialization.JsonPropertyName("responseLogprobs")] public bool? ResponseLogprobs { get; set; } - /// - /// Config for thinking features. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("thinkingConfig")] - public global::Google.Gemini.ThinkingConfig? ThinkingConfig { get; set; } - /// /// Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text. /// @@ -100,28 +105,17 @@ public sealed partial class GenerationConfig public global::System.Collections.Generic.IList? ResponseModalities { get; set; } /// - /// Optional. Enables enhanced civic answers. It may not be available for all models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enableEnhancedCivicAnswers")] - public bool? EnableEnhancedCivicAnswers { get; set; } - - /// - /// Optional. Seed used in decoding. If not set, the request uses a randomly generated seed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family) + /// Config for thinking features. /// - [global::System.Text.Json.Serialization.JsonPropertyName("candidateCount")] - public int? CandidateCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("thinkingConfig")] + public global::Google.Gemini.ThinkingConfig? ThinkingConfig { get; set; } /// - /// Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit. + /// Optional. If specified, the media resolution specified will be used. /// - [global::System.Text.Json.Serialization.JsonPropertyName("frequencyPenalty")] - public float? FrequencyPenalty { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("mediaResolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.GenerationConfigMediaResolutionJsonConverter))] + public global::Google.Gemini.GenerationConfigMediaResolution? MediaResolution { get; set; } /// /// Config for speech generation and transcription. @@ -129,6 +123,12 @@ public sealed partial class GenerationConfig [global::System.Text.Json.Serialization.JsonPropertyName("speechConfig")] public global::Google.Gemini.SpeechConfig? SpeechConfig { get; set; } + /// + /// Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] + public float? Temperature { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -138,111 +138,111 @@ public sealed partial class GenerationConfig /// /// Initializes a new instance of the class. /// - /// - /// Optional. If specified, the media resolution specified will be used. + /// + /// Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit. /// /// /// Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests. /// - /// - /// Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests. + /// + /// Optional. Enables enhanced civic answers. It may not be available for all models. /// /// /// Config for image generation features. /// + /// + /// Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary. + /// /// /// Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function. /// - /// - /// Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]. + /// + /// Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types. /// - /// - /// Optional. An internal detail. Use `responseJsonSchema` rather than this field. + /// + /// Optional. Seed used in decoding. If not set, the request uses a randomly generated seed. + /// + /// + /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). /// /// /// Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20]. /// - /// - /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). + /// + /// Optional. An internal detail. Use `responseJsonSchema` rather than this field. /// - /// - /// Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary. + /// + /// Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family) + /// + /// + /// Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests. /// /// /// Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response. /// - /// - /// Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types. - /// /// /// Optional. If true, export the logprobs results in response. /// - /// - /// Config for thinking features. - /// /// /// Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text. /// - /// - /// Optional. Enables enhanced civic answers. It may not be available for all models. - /// - /// - /// Optional. Seed used in decoding. If not set, the request uses a randomly generated seed. - /// - /// - /// Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family) + /// + /// Config for thinking features. /// - /// - /// Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit. + /// + /// Optional. If specified, the media resolution specified will be used. /// /// /// Config for speech generation and transcription. /// + /// + /// Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GenerationConfig( - global::Google.Gemini.GenerationConfigMediaResolution? mediaResolution, + float? frequencyPenalty, float? topP, - int? topK, + bool? enableEnhancedCivicAnswers, global::Google.Gemini.ImageConfig? imageConfig, + float? presencePenalty, int? maxOutputTokens, - float? temperature, - object? responseJsonSchema, - int? logprobs, + string? responseMimeType, + int? seed, global::Google.Gemini.Schema? responseSchema, - float? presencePenalty, + int? logprobs, + object? responseJsonSchema, + int? candidateCount, + int? topK, global::System.Collections.Generic.IList? stopSequences, - string? responseMimeType, bool? responseLogprobs, - global::Google.Gemini.ThinkingConfig? thinkingConfig, global::System.Collections.Generic.IList? responseModalities, - bool? enableEnhancedCivicAnswers, - int? seed, - int? candidateCount, - float? frequencyPenalty, - global::Google.Gemini.SpeechConfig? speechConfig) + global::Google.Gemini.ThinkingConfig? thinkingConfig, + global::Google.Gemini.GenerationConfigMediaResolution? mediaResolution, + global::Google.Gemini.SpeechConfig? speechConfig, + float? temperature) { - this.MediaResolution = mediaResolution; + this.FrequencyPenalty = frequencyPenalty; this.TopP = topP; - this.TopK = topK; + this.EnableEnhancedCivicAnswers = enableEnhancedCivicAnswers; this.ImageConfig = imageConfig; + this.PresencePenalty = presencePenalty; this.MaxOutputTokens = maxOutputTokens; - this.Temperature = temperature; - this.ResponseJsonSchema = responseJsonSchema; - this.Logprobs = logprobs; + this.ResponseMimeType = responseMimeType; + this.Seed = seed; this.ResponseSchema = responseSchema; - this.PresencePenalty = presencePenalty; + this.Logprobs = logprobs; + this.ResponseJsonSchema = responseJsonSchema; + this.CandidateCount = candidateCount; + this.TopK = topK; this.StopSequences = stopSequences; - this.ResponseMimeType = responseMimeType; this.ResponseLogprobs = responseLogprobs; - this.ThinkingConfig = thinkingConfig; this.ResponseModalities = responseModalities; - this.EnableEnhancedCivicAnswers = enableEnhancedCivicAnswers; - this.Seed = seed; - this.CandidateCount = candidateCount; - this.FrequencyPenalty = frequencyPenalty; + this.ThinkingConfig = thinkingConfig; + this.MediaResolution = mediaResolution; this.SpeechConfig = speechConfig; + this.Temperature = temperature; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaGroundingSupport.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaGroundingSupport.g.cs index efe6a782a..221642aa0 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaGroundingSupport.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaGroundingSupport.g.cs @@ -8,12 +8,24 @@ namespace Google.Gemini /// public sealed partial class GoogleAiGenerativelanguageV1betaGroundingSupport { + /// + /// Segment of the content. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("segment")] + public global::Google.Gemini.GoogleAiGenerativelanguageV1betaSegment? Segment { get; set; } + /// /// Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order). /// [global::System.Text.Json.Serialization.JsonPropertyName("groundingChunkIndices")] public global::System.Collections.Generic.IList? GroundingChunkIndices { get; set; } + /// + /// Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("confidenceScores")] + public global::System.Collections.Generic.IList? ConfidenceScores { get; set; } + /// /// Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.
/// Included only in responses @@ -21,18 +33,6 @@ public sealed partial class GoogleAiGenerativelanguageV1betaGroundingSupport [global::System.Text.Json.Serialization.JsonPropertyName("renderedParts")] public global::System.Collections.Generic.IList? RenderedParts { get; set; } - /// - /// Segment of the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("segment")] - public global::Google.Gemini.GoogleAiGenerativelanguageV1betaSegment? Segment { get; set; } - - /// - /// Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("confidenceScores")] - public global::System.Collections.Generic.IList? ConfidenceScores { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -42,32 +42,32 @@ public sealed partial class GoogleAiGenerativelanguageV1betaGroundingSupport /// /// Initializes a new instance of the class. /// + /// + /// Segment of the content. + /// /// /// Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order). /// + /// + /// Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices. + /// /// /// Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.
/// Included only in responses /// - /// - /// Segment of the content. - /// - /// - /// Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GoogleAiGenerativelanguageV1betaGroundingSupport( - global::System.Collections.Generic.IList? groundingChunkIndices, - global::System.Collections.Generic.IList? renderedParts, global::Google.Gemini.GoogleAiGenerativelanguageV1betaSegment? segment, - global::System.Collections.Generic.IList? confidenceScores) + global::System.Collections.Generic.IList? groundingChunkIndices, + global::System.Collections.Generic.IList? confidenceScores, + global::System.Collections.Generic.IList? renderedParts) { - this.GroundingChunkIndices = groundingChunkIndices; - this.RenderedParts = renderedParts; this.Segment = segment; + this.GroundingChunkIndices = groundingChunkIndices; this.ConfidenceScores = confidenceScores; + this.RenderedParts = renderedParts; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaSegment.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaSegment.g.cs index 9f01674a8..afd475c48 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaSegment.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GoogleAiGenerativelanguageV1betaSegment.g.cs @@ -20,18 +20,18 @@ public sealed partial class GoogleAiGenerativelanguageV1betaSegment [global::System.Text.Json.Serialization.JsonPropertyName("endIndex")] public int? EndIndex { get; set; } - /// - /// Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("startIndex")] - public int? StartIndex { get; set; } - /// /// The index of a Part object within its parent Content object. /// [global::System.Text.Json.Serialization.JsonPropertyName("partIndex")] public int? PartIndex { get; set; } + /// + /// Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("startIndex")] + public int? StartIndex { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -47,25 +47,25 @@ public sealed partial class GoogleAiGenerativelanguageV1betaSegment /// /// End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero. /// - /// - /// Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. - /// /// /// The index of a Part object within its parent Content object. /// + /// + /// Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GoogleAiGenerativelanguageV1betaSegment( string? text, int? endIndex, - int? startIndex, - int? partIndex) + int? partIndex, + int? startIndex) { this.Text = text; this.EndIndex = endIndex; - this.StartIndex = startIndex; this.PartIndex = partIndex; + this.StartIndex = startIndex; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunk.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunk.g.cs index ac519a572..3ee594d4b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunk.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunk.g.cs @@ -14,18 +14,18 @@ public sealed partial class GroundingChunk [global::System.Text.Json.Serialization.JsonPropertyName("web")] public global::Google.Gemini.Web? Web { get; set; } - /// - /// Chunk from context retrieved by the file search tool. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("retrievedContext")] - public global::Google.Gemini.RetrievedContext? RetrievedContext { get; set; } - /// /// Chunk from image search. /// [global::System.Text.Json.Serialization.JsonPropertyName("image")] public global::Google.Gemini.Image? Image { get; set; } + /// + /// Chunk from context retrieved by the file search tool. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("retrievedContext")] + public global::Google.Gemini.RetrievedContext? RetrievedContext { get; set; } + /// /// A grounding chunk from Google Maps. A Maps chunk corresponds to a single place. /// @@ -44,12 +44,12 @@ public sealed partial class GroundingChunk /// /// Chunk from the web. /// - /// - /// Chunk from context retrieved by the file search tool. - /// /// /// Chunk from image search. /// + /// + /// Chunk from context retrieved by the file search tool. + /// /// /// A grounding chunk from Google Maps. A Maps chunk corresponds to a single place. /// @@ -58,13 +58,13 @@ public sealed partial class GroundingChunk #endif public GroundingChunk( global::Google.Gemini.Web? web, - global::Google.Gemini.RetrievedContext? retrievedContext, global::Google.Gemini.Image? image, + global::Google.Gemini.RetrievedContext? retrievedContext, global::Google.Gemini.Maps? maps) { this.Web = web; - this.RetrievedContext = retrievedContext; this.Image = image; + this.RetrievedContext = retrievedContext; this.Maps = maps; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunkCustomMetadata.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunkCustomMetadata.g.cs index 9976e845f..0e0705488 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunkCustomMetadata.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingChunkCustomMetadata.g.cs @@ -8,6 +8,12 @@ namespace Google.Gemini /// public sealed partial class GroundingChunkCustomMetadata { + /// + /// Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("numericValue")] + public float? NumericValue { get; set; } + /// /// Optional. The string value of the metadata. /// @@ -26,12 +32,6 @@ public sealed partial class GroundingChunkCustomMetadata [global::System.Text.Json.Serialization.JsonPropertyName("key")] public string? Key { get; set; } - /// - /// Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("numericValue")] - public float? NumericValue { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -41,6 +41,9 @@ public sealed partial class GroundingChunkCustomMetadata /// /// Initializes a new instance of the class. /// + /// + /// Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used. + /// /// /// Optional. The string value of the metadata. /// @@ -50,22 +53,19 @@ public sealed partial class GroundingChunkCustomMetadata /// /// The key of the metadata. /// - /// - /// Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GroundingChunkCustomMetadata( + float? numericValue, string? stringValue, global::Google.Gemini.GroundingChunkStringList? stringListValue, - string? key, - float? numericValue) + string? key) { + this.NumericValue = numericValue; this.StringValue = stringValue; this.StringListValue = stringListValue; this.Key = key; - this.NumericValue = numericValue; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingMetadata.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingMetadata.g.cs index 4b5e0457f..3649dce75 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingMetadata.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.GroundingMetadata.g.cs @@ -8,6 +8,18 @@ namespace Google.Gemini /// public sealed partial class GroundingMetadata { + /// + /// Web search queries for the following-up web search. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("webSearchQueries")] + public global::System.Collections.Generic.IList? WebSearchQueries { get; set; } + + /// + /// List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("groundingChunks")] + public global::System.Collections.Generic.IList? GroundingChunks { get; set; } + /// /// List of grounding support. /// @@ -15,10 +27,10 @@ public sealed partial class GroundingMetadata public global::System.Collections.Generic.IList? GroundingSupports { get; set; } /// - /// Web search queries for the following-up web search. + /// Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled. /// - [global::System.Text.Json.Serialization.JsonPropertyName("webSearchQueries")] - public global::System.Collections.Generic.IList? WebSearchQueries { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("googleMapsWidgetContextToken")] + public string? GoogleMapsWidgetContextToken { get; set; } /// /// Google search entry point. @@ -38,18 +50,6 @@ public sealed partial class GroundingMetadata [global::System.Text.Json.Serialization.JsonPropertyName("retrievalMetadata")] public global::Google.Gemini.RetrievalMetadata? RetrievalMetadata { get; set; } - /// - /// List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("groundingChunks")] - public global::System.Collections.Generic.IList? GroundingChunks { get; set; } - - /// - /// Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("googleMapsWidgetContextToken")] - public string? GoogleMapsWidgetContextToken { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -59,11 +59,17 @@ public sealed partial class GroundingMetadata /// /// Initializes a new instance of the class. /// + /// + /// Web search queries for the following-up web search. + /// + /// + /// List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses. + /// /// /// List of grounding support. /// - /// - /// Web search queries for the following-up web search. + /// + /// Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled. /// /// /// Google search entry point. @@ -74,31 +80,25 @@ public sealed partial class GroundingMetadata /// /// Metadata related to retrieval in the grounding flow. /// - /// - /// List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses. - /// - /// - /// Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GroundingMetadata( - global::System.Collections.Generic.IList? groundingSupports, global::System.Collections.Generic.IList? webSearchQueries, + global::System.Collections.Generic.IList? groundingChunks, + global::System.Collections.Generic.IList? groundingSupports, + string? googleMapsWidgetContextToken, global::Google.Gemini.SearchEntryPoint? searchEntryPoint, global::System.Collections.Generic.IList? imageSearchQueries, - global::Google.Gemini.RetrievalMetadata? retrievalMetadata, - global::System.Collections.Generic.IList? groundingChunks, - string? googleMapsWidgetContextToken) + global::Google.Gemini.RetrievalMetadata? retrievalMetadata) { - this.GroundingSupports = groundingSupports; this.WebSearchQueries = webSearchQueries; + this.GroundingChunks = groundingChunks; + this.GroundingSupports = groundingSupports; + this.GoogleMapsWidgetContextToken = googleMapsWidgetContextToken; this.SearchEntryPoint = searchEntryPoint; this.ImageSearchQueries = imageSearchQueries; this.RetrievalMetadata = retrievalMetadata; - this.GroundingChunks = groundingChunks; - this.GoogleMapsWidgetContextToken = googleMapsWidgetContextToken; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Hyperparameters.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Hyperparameters.g.cs index 7e0b9cd83..9bc3820b2 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Hyperparameters.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Hyperparameters.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class Hyperparameters { - /// - /// Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("epochCount")] - public int? EpochCount { get; set; } - /// /// Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples. /// @@ -26,6 +20,12 @@ public sealed partial class Hyperparameters [global::System.Text.Json.Serialization.JsonPropertyName("learningRateMultiplier")] public float? LearningRateMultiplier { get; set; } + /// + /// Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("epochCount")] + public int? EpochCount { get; set; } + /// /// Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. /// @@ -41,15 +41,15 @@ public sealed partial class Hyperparameters /// /// Initializes a new instance of the class. /// - /// - /// Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. - /// /// /// Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples. /// /// /// Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used. /// + /// + /// Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. + /// /// /// Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. /// @@ -57,14 +57,14 @@ public sealed partial class Hyperparameters [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Hyperparameters( - int? epochCount, float? learningRate, float? learningRateMultiplier, + int? epochCount, int? batchSize) { - this.EpochCount = epochCount; this.LearningRate = learningRate; this.LearningRateMultiplier = learningRateMultiplier; + this.EpochCount = epochCount; this.BatchSize = batchSize; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Image.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Image.g.cs index b4add7f1e..36f43bee7 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Image.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Image.g.cs @@ -14,12 +14,6 @@ public sealed partial class Image [global::System.Text.Json.Serialization.JsonPropertyName("title")] public string? Title { get; set; } - /// - /// The root domain of the web page that the image is from, e.g. "example.com". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("domain")] - public string? Domain { get; set; } - /// /// The web page URI for attribution. /// @@ -32,6 +26,12 @@ public sealed partial class Image [global::System.Text.Json.Serialization.JsonPropertyName("imageUri")] public string? ImageUri { get; set; } + /// + /// The root domain of the web page that the image is from, e.g. "example.com". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("domain")] + public string? Domain { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -44,28 +44,28 @@ public sealed partial class Image /// /// The title of the web page that the image is from. /// - /// - /// The root domain of the web page that the image is from, e.g. "example.com". - /// /// /// The web page URI for attribution. /// /// /// The image asset URL. /// + /// + /// The root domain of the web page that the image is from, e.g. "example.com". + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Image( string? title, - string? domain, string? sourceUri, - string? imageUri) + string? imageUri, + string? domain) { this.Title = title; - this.Domain = domain; this.SourceUri = sourceUri; this.ImageUri = imageUri; + this.Domain = domain; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ImportFileRequest.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ImportFileRequest.g.cs index 0c6351f1b..d42bb5341 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ImportFileRequest.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ImportFileRequest.g.cs @@ -9,10 +9,10 @@ namespace Google.Gemini public sealed partial class ImportFileRequest { /// - /// Custom metadata to be associated with the file. + /// Required. The name of the `File` to import. Example: `files/abc-123` /// - [global::System.Text.Json.Serialization.JsonPropertyName("customMetadata")] - public global::System.Collections.Generic.IList? CustomMetadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("fileName")] + public string? FileName { get; set; } /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto @@ -21,10 +21,10 @@ public sealed partial class ImportFileRequest public global::Google.Gemini.ChunkingConfig? ChunkingConfig { get; set; } /// - /// Required. The name of the `File` to import. Example: `files/abc-123` + /// Custom metadata to be associated with the file. /// - [global::System.Text.Json.Serialization.JsonPropertyName("fileName")] - public string? FileName { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("customMetadata")] + public global::System.Collections.Generic.IList? CustomMetadata { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -35,26 +35,26 @@ public sealed partial class ImportFileRequest /// /// Initializes a new instance of the class. /// - /// - /// Custom metadata to be associated with the file. + /// + /// Required. The name of the `File` to import. Example: `files/abc-123` /// /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto /// - /// - /// Required. The name of the `File` to import. Example: `files/abc-123` + /// + /// Custom metadata to be associated with the file. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ImportFileRequest( - global::System.Collections.Generic.IList? customMetadata, + string? fileName, global::Google.Gemini.ChunkingConfig? chunkingConfig, - string? fileName) + global::System.Collections.Generic.IList? customMetadata) { - this.CustomMetadata = customMetadata; - this.ChunkingConfig = chunkingConfig; this.FileName = fileName; + this.ChunkingConfig = chunkingConfig; + this.CustomMetadata = customMetadata; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.InlinedEmbedContentResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.InlinedEmbedContentResponse.g.cs index 5849d8d11..d705a9787 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.InlinedEmbedContentResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.InlinedEmbedContentResponse.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class InlinedEmbedContentResponse { - /// - /// The response to an `EmbedContentRequest`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response")] - public global::Google.Gemini.EmbedContentResponse? Response { get; set; } - /// /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). /// [global::System.Text.Json.Serialization.JsonPropertyName("error")] public global::Google.Gemini.Status? Error { get; set; } + /// + /// The response to an `EmbedContentRequest`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("response")] + public global::Google.Gemini.EmbedContentResponse? Response { get; set; } + /// /// Output only. The metadata associated with the request.
/// Included only in responses @@ -36,12 +36,12 @@ public sealed partial class InlinedEmbedContentResponse /// /// Initializes a new instance of the class. /// - /// - /// The response to an `EmbedContentRequest`. - /// /// /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). /// + /// + /// The response to an `EmbedContentRequest`. + /// /// /// Output only. The metadata associated with the request.
/// Included only in responses @@ -50,12 +50,12 @@ public sealed partial class InlinedEmbedContentResponse [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public InlinedEmbedContentResponse( - global::Google.Gemini.EmbedContentResponse? response, global::Google.Gemini.Status? error, + global::Google.Gemini.EmbedContentResponse? response, object? metadata) { - this.Response = response; this.Error = error; + this.Response = response; this.Metadata = metadata; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Interval.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Interval.g.cs index 0ba65b3e8..d5800e1d6 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Interval.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Interval.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini ///
public sealed partial class Interval { - /// - /// Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("endTime")] - public string? EndTime { get; set; } - /// /// Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. /// [global::System.Text.Json.Serialization.JsonPropertyName("startTime")] public string? StartTime { get; set; } + /// + /// Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endTime")] + public string? EndTime { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -29,21 +29,21 @@ public sealed partial class Interval /// /// Initializes a new instance of the class. /// - /// - /// Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. - /// /// /// Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. /// + /// + /// Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Interval( - string? endTime, - string? startTime) + string? startTime, + string? endTime) { - this.EndTime = endTime; this.StartTime = startTime; + this.EndTime = endTime; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LatLng.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LatLng.g.cs index d54084716..8f9cc3b2c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LatLng.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LatLng.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class LatLng { - /// - /// The latitude in degrees. It must be in the range [-90.0, +90.0]. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("latitude")] - public double? Latitude { get; set; } - /// /// The longitude in degrees. It must be in the range [-180.0, +180.0]. /// [global::System.Text.Json.Serialization.JsonPropertyName("longitude")] public double? Longitude { get; set; } + /// + /// The latitude in degrees. It must be in the range [-90.0, +90.0]. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("latitude")] + public double? Latitude { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -29,21 +29,21 @@ public sealed partial class LatLng /// /// Initializes a new instance of the class. /// - /// - /// The latitude in degrees. It must be in the range [-90.0, +90.0]. - /// /// /// The longitude in degrees. It must be in the range [-180.0, +180.0]. /// + /// + /// The latitude in degrees. It must be in the range [-90.0, +90.0]. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public LatLng( - double? latitude, - double? longitude) + double? longitude, + double? latitude) { - this.Latitude = latitude; this.Longitude = longitude; + this.Latitude = latitude; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListCachedContentsResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListCachedContentsResponse.g.cs index d8960e0af..6b112b840 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListCachedContentsResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListCachedContentsResponse.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class ListCachedContentsResponse { - /// - /// List of cached contents. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cachedContents")] - public global::System.Collections.Generic.IList? CachedContents { get; set; } - /// /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. /// [global::System.Text.Json.Serialization.JsonPropertyName("nextPageToken")] public string? NextPageToken { get; set; } + /// + /// List of cached contents. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cachedContents")] + public global::System.Collections.Generic.IList? CachedContents { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -29,21 +29,21 @@ public sealed partial class ListCachedContentsResponse /// /// Initializes a new instance of the class. /// - /// - /// List of cached contents. - /// /// /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. /// + /// + /// List of cached contents. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListCachedContentsResponse( - global::System.Collections.Generic.IList? cachedContents, - string? nextPageToken) + string? nextPageToken, + global::System.Collections.Generic.IList? cachedContents) { - this.CachedContents = cachedContents; this.NextPageToken = nextPageToken; + this.CachedContents = cachedContents; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListGeneratedFilesResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListGeneratedFilesResponse.g.cs index 3ac3fc7f6..761cfc987 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListGeneratedFilesResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListGeneratedFilesResponse.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class ListGeneratedFilesResponse { - /// - /// A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("nextPageToken")] - public string? NextPageToken { get; set; } - /// /// The list of `GeneratedFile`s. /// [global::System.Text.Json.Serialization.JsonPropertyName("generatedFiles")] public global::System.Collections.Generic.IList? GeneratedFiles { get; set; } + /// + /// A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nextPageToken")] + public string? NextPageToken { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -29,21 +29,21 @@ public sealed partial class ListGeneratedFilesResponse /// /// Initializes a new instance of the class. /// - /// - /// A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call. - /// /// /// The list of `GeneratedFile`s. /// + /// + /// A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListGeneratedFilesResponse( - string? nextPageToken, - global::System.Collections.Generic.IList? generatedFiles) + global::System.Collections.Generic.IList? generatedFiles, + string? nextPageToken) { - this.NextPageToken = nextPageToken; this.GeneratedFiles = generatedFiles; + this.NextPageToken = nextPageToken; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListOperationsResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListOperationsResponse.g.cs index ba86db665..35553f7f9 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListOperationsResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ListOperationsResponse.g.cs @@ -14,18 +14,18 @@ public sealed partial class ListOperationsResponse [global::System.Text.Json.Serialization.JsonPropertyName("operations")] public global::System.Collections.Generic.IList? Operations { get; set; } - /// - /// Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("unreachable")] - public global::System.Collections.Generic.IList? Unreachable { get; set; } - /// /// The standard List next-page token. /// [global::System.Text.Json.Serialization.JsonPropertyName("nextPageToken")] public string? NextPageToken { get; set; } + /// + /// Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("unreachable")] + public global::System.Collections.Generic.IList? Unreachable { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -38,23 +38,23 @@ public sealed partial class ListOperationsResponse /// /// A list of operations that matches the specified filter in the request. /// - /// - /// Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations. - /// /// /// The standard List next-page token. /// + /// + /// Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListOperationsResponse( global::System.Collections.Generic.IList? operations, - global::System.Collections.Generic.IList? unreachable, - string? nextPageToken) + string? nextPageToken, + global::System.Collections.Generic.IList? unreachable) { this.Operations = operations; - this.Unreachable = unreachable; this.NextPageToken = nextPageToken; + this.Unreachable = unreachable; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LogprobsResultCandidate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LogprobsResultCandidate.g.cs index 1c4558c4e..0d7b89520 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LogprobsResultCandidate.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.LogprobsResultCandidate.g.cs @@ -8,6 +8,12 @@ namespace Google.Gemini /// public sealed partial class LogprobsResultCandidate { + /// + /// The candidate's log probability. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("logProbability")] + public float? LogProbability { get; set; } + /// /// The candidate’s token string value. /// @@ -20,12 +26,6 @@ public sealed partial class LogprobsResultCandidate [global::System.Text.Json.Serialization.JsonPropertyName("tokenId")] public int? TokenId { get; set; } - /// - /// The candidate's log probability. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("logProbability")] - public float? LogProbability { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -35,26 +35,26 @@ public sealed partial class LogprobsResultCandidate /// /// Initializes a new instance of the class. /// + /// + /// The candidate's log probability. + /// /// /// The candidate’s token string value. /// /// /// The candidate’s token id value. /// - /// - /// The candidate's log probability. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public LogprobsResultCandidate( + float? logProbability, string? token, - int? tokenId, - float? logProbability) + int? tokenId) { + this.LogProbability = logProbability; this.Token = token; this.TokenId = tokenId; - this.LogProbability = logProbability; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Maps.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Maps.g.cs index 90ecdf95e..ed79fb185 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Maps.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Maps.g.cs @@ -20,6 +20,12 @@ public sealed partial class Maps [global::System.Text.Json.Serialization.JsonPropertyName("placeAnswerSources")] public global::Google.Gemini.PlaceAnswerSources? PlaceAnswerSources { get; set; } + /// + /// URI reference of the place. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("uri")] + public string? Uri { get; set; } + /// /// Text description of the place answer. /// @@ -32,12 +38,6 @@ public sealed partial class Maps [global::System.Text.Json.Serialization.JsonPropertyName("title")] public string? Title { get; set; } - /// - /// URI reference of the place. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("uri")] - public string? Uri { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -53,30 +53,30 @@ public sealed partial class Maps /// /// Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: "does Bar Foo have Wifi" or "is Foo Bar wheelchair accessible?"). Currently we only support review snippets as sources. /// + /// + /// URI reference of the place. + /// /// /// Text description of the place answer. /// /// /// Title of the place. /// - /// - /// URI reference of the place. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Maps( string? placeId, global::Google.Gemini.PlaceAnswerSources? placeAnswerSources, + string? uri, string? text, - string? title, - string? uri) + string? title) { this.PlaceId = placeId; this.PlaceAnswerSources = placeAnswerSources; + this.Uri = uri; this.Text = text; this.Title = title; - this.Uri = uri; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModalityTokenCount.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModalityTokenCount.g.cs index b9c043c10..f9e614fa1 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModalityTokenCount.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModalityTokenCount.g.cs @@ -8,6 +8,12 @@ namespace Google.Gemini /// public sealed partial class ModalityTokenCount { + /// + /// Number of tokens. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tokenCount")] + public int? TokenCount { get; set; } + /// /// The modality associated with this token count. /// @@ -15,12 +21,6 @@ public sealed partial class ModalityTokenCount [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.ModalityTokenCountModalityJsonConverter))] public global::Google.Gemini.ModalityTokenCountModality? Modality { get; set; } - /// - /// Number of tokens. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("tokenCount")] - public int? TokenCount { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -30,21 +30,21 @@ public sealed partial class ModalityTokenCount /// /// Initializes a new instance of the class. /// - /// - /// The modality associated with this token count. - /// /// /// Number of tokens. /// + /// + /// The modality associated with this token count. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ModalityTokenCount( - global::Google.Gemini.ModalityTokenCountModality? modality, - int? tokenCount) + int? tokenCount, + global::Google.Gemini.ModalityTokenCountModality? modality) { - this.Modality = modality; this.TokenCount = tokenCount; + this.Modality = modality; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Model.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Model.g.cs index 3aefd63cd..e4a2fc022 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Model.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Model.g.cs @@ -9,10 +9,22 @@ namespace Google.Gemini public sealed partial class Model { /// - /// Maximum number of output tokens available for this model. + /// The maximum temperature this model can use. /// - [global::System.Text.Json.Serialization.JsonPropertyName("outputTokenLimit")] - public int? OutputTokenLimit { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("maxTemperature")] + public float? MaxTemperature { get; set; } + + /// + /// For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("topK")] + public int? TopK { get; set; } + + /// + /// Maximum number of input tokens allowed for this model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("inputTokenLimit")] + public int? InputTokenLimit { get; set; } /// /// Required. The version number of the model. This represents the major version (`1.0` or `1.5`) @@ -21,28 +33,28 @@ public sealed partial class Model public string? Version { get; set; } /// - /// The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`. + /// Whether the model supports thinking. /// - [global::System.Text.Json.Serialization.JsonPropertyName("supportedGenerationMethods")] - public global::System.Collections.Generic.IList? SupportedGenerationMethods { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("thinking")] + public bool? Thinking { get; set; } /// - /// The maximum temperature this model can use. + /// Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash` /// - [global::System.Text.Json.Serialization.JsonPropertyName("maxTemperature")] - public float? MaxTemperature { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("baseModelId")] + public string? BaseModelId { get; set; } /// - /// A short description of the model. + /// The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters. /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } /// - /// Maximum number of input tokens allowed for this model. + /// Maximum number of output tokens available for this model. /// - [global::System.Text.Json.Serialization.JsonPropertyName("inputTokenLimit")] - public int? InputTokenLimit { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("outputTokenLimit")] + public int? OutputTokenLimit { get; set; } /// /// Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model. @@ -57,28 +69,16 @@ public sealed partial class Model public float? TopP { get; set; } /// - /// For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("topK")] - public int? TopK { get; set; } - - /// - /// Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash` - /// - [global::System.Text.Json.Serialization.JsonPropertyName("baseModelId")] - public string? BaseModelId { get; set; } - - /// - /// The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters. + /// A short description of the model. /// - [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] - public string? DisplayName { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } /// - /// Whether the model supports thinking. + /// The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`. /// - [global::System.Text.Json.Serialization.JsonPropertyName("thinking")] - public bool? Thinking { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("supportedGenerationMethods")] + public global::System.Collections.Generic.IList? SupportedGenerationMethods { get; set; } /// /// Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * "{base_model_id}-{version}" Examples: * `models/gemini-1.5-flash-001` @@ -95,32 +95,20 @@ public sealed partial class Model /// /// Initializes a new instance of the class. /// - /// - /// Maximum number of output tokens available for this model. - /// - /// - /// Required. The version number of the model. This represents the major version (`1.0` or `1.5`) - /// - /// - /// The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`. - /// /// /// The maximum temperature this model can use. /// - /// - /// A short description of the model. + /// + /// For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter. /// /// /// Maximum number of input tokens allowed for this model. /// - /// - /// Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model. - /// - /// - /// For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model. + /// + /// Required. The version number of the model. This represents the major version (`1.0` or `1.5`) /// - /// - /// For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter. + /// + /// Whether the model supports thinking. /// /// /// Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash` @@ -128,8 +116,20 @@ public sealed partial class Model /// /// The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters. /// - /// - /// Whether the model supports thinking. + /// + /// Maximum number of output tokens available for this model. + /// + /// + /// Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model. + /// + /// + /// For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model. + /// + /// + /// A short description of the model. + /// + /// + /// The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`. /// /// /// Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * "{base_model_id}-{version}" Examples: * `models/gemini-1.5-flash-001` @@ -138,32 +138,32 @@ public sealed partial class Model [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Model( - int? outputTokenLimit, - string? version, - global::System.Collections.Generic.IList? supportedGenerationMethods, float? maxTemperature, - string? description, - int? inputTokenLimit, - float? temperature, - float? topP, int? topK, + int? inputTokenLimit, + string? version, + bool? thinking, string? baseModelId, string? displayName, - bool? thinking, + int? outputTokenLimit, + float? temperature, + float? topP, + string? description, + global::System.Collections.Generic.IList? supportedGenerationMethods, string? name) { - this.OutputTokenLimit = outputTokenLimit; - this.Version = version; - this.SupportedGenerationMethods = supportedGenerationMethods; this.MaxTemperature = maxTemperature; - this.Description = description; - this.InputTokenLimit = inputTokenLimit; - this.Temperature = temperature; - this.TopP = topP; this.TopK = topK; + this.InputTokenLimit = inputTokenLimit; + this.Version = version; + this.Thinking = thinking; this.BaseModelId = baseModelId; this.DisplayName = displayName; - this.Thinking = thinking; + this.OutputTokenLimit = outputTokenLimit; + this.Temperature = temperature; + this.TopP = topP; + this.Description = description; + this.SupportedGenerationMethods = supportedGenerationMethods; this.Name = name; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModelStatus.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModelStatus.g.cs index aff638adf..0da3ec088 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModelStatus.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ModelStatus.g.cs @@ -14,12 +14,6 @@ public sealed partial class ModelStatus [global::System.Text.Json.Serialization.JsonPropertyName("retirementTime")] public string? RetirementTime { get; set; } - /// - /// A message explaining the model status. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("message")] - public string? Message { get; set; } - /// /// The stage of the underlying model. /// @@ -27,6 +21,12 @@ public sealed partial class ModelStatus [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.ModelStatusModelStageJsonConverter))] public global::Google.Gemini.ModelStatusModelStage? ModelStage { get; set; } + /// + /// A message explaining the model status. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -39,23 +39,23 @@ public sealed partial class ModelStatus /// /// The time at which the model will be retired. /// - /// - /// A message explaining the model status. - /// /// /// The stage of the underlying model. /// + /// + /// A message explaining the model status. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ModelStatus( string? retirementTime, - string? message, - global::Google.Gemini.ModelStatusModelStage? modelStage) + global::Google.Gemini.ModelStatusModelStage? modelStage, + string? message) { this.RetirementTime = retirementTime; - this.Message = message; this.ModelStage = modelStage; + this.Message = message; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Operation.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Operation.g.cs index bfa748221..273e47042 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Operation.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Operation.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class Operation { - /// - /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("done")] - public bool? Done { get; set; } - /// /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] public string? Name { get; set; } + /// + /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::Google.Gemini.Status? Error { get; set; } + /// /// The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. /// @@ -27,16 +27,16 @@ public sealed partial class Operation public object? Response { get; set; } /// - /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public object? Metadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("done")] + public bool? Done { get; set; } /// - /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public global::Google.Gemini.Status? Error { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public object? Metadata { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -47,36 +47,36 @@ public sealed partial class Operation /// /// Initializes a new instance of the class. /// - /// - /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. - /// /// /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. /// + /// + /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + /// /// /// The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. /// + /// + /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. + /// /// /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. /// - /// - /// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Operation( - bool? done, string? name, + global::Google.Gemini.Status? error, object? response, - object? metadata, - global::Google.Gemini.Status? error) + bool? done, + object? metadata) { - this.Done = done; this.Name = name; + this.Error = error; this.Response = response; + this.Done = done; this.Metadata = metadata; - this.Error = error; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Part.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Part.g.cs index ba655522c..4fc189883 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Part.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Part.g.cs @@ -11,83 +11,83 @@ namespace Google.Gemini public sealed partial class Part { /// - /// A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values. + /// The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. /// - [global::System.Text.Json.Serialization.JsonPropertyName("functionCall")] - public global::Google.Gemini.FunctionCall? FunctionCall { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("toolResponse")] + public global::Google.Gemini.ToolResponse? ToolResponse { get; set; } /// - /// Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content. + /// Optional. An opaque signature for the thought so it can be reused in subsequent requests. /// - [global::System.Text.Json.Serialization.JsonPropertyName("videoMetadata")] - [global::System.Obsolete("This property marked as deprecated.")] - public global::Google.Gemini.VideoMetadata? VideoMetadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("thoughtSignature")] + public byte[]? ThoughtSignature { get; set; } /// - /// The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction. + /// Inline text. /// - [global::System.Text.Json.Serialization.JsonPropertyName("functionResponse")] - public global::Google.Gemini.FunctionResponse? FunctionResponse { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + public string? Text { get; set; } /// - /// A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. + /// Optional. Indicates if the part is thought from the model. /// - [global::System.Text.Json.Serialization.JsonPropertyName("toolCall")] - public global::Google.Gemini.ToolCall? ToolCall { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("thought")] + public bool? Thought { get; set; } /// - /// Raw media bytes. Text should not be sent as raw bytes, use the 'text' field. + /// A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values. /// - [global::System.Text.Json.Serialization.JsonPropertyName("inlineData")] - public global::Google.Gemini.Blob? InlineData { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("functionCall")] + public global::Google.Gemini.FunctionCall? FunctionCall { get; set; } /// - /// Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. + /// Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated. /// - [global::System.Text.Json.Serialization.JsonPropertyName("partMetadata")] - public object? PartMetadata { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("executableCode")] + public global::Google.Gemini.ExecutableCode? ExecutableCode { get; set; } /// - /// Inline text. + /// Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content. /// - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - public string? Text { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("videoMetadata")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::Google.Gemini.VideoMetadata? VideoMetadata { get; set; } /// - /// Optional. An opaque signature for the thought so it can be reused in subsequent requests. + /// Raw media bytes. Text should not be sent as raw bytes, use the 'text' field. /// - [global::System.Text.Json.Serialization.JsonPropertyName("thoughtSignature")] - public byte[]? ThoughtSignature { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("inlineData")] + public global::Google.Gemini.Blob? InlineData { get; set; } /// - /// The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. + /// The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction. /// - [global::System.Text.Json.Serialization.JsonPropertyName("toolResponse")] - public global::Google.Gemini.ToolResponse? ToolResponse { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("functionResponse")] + public global::Google.Gemini.FunctionResponse? FunctionResponse { get; set; } /// - /// Optional. Indicates if the part is thought from the model. + /// Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used. /// - [global::System.Text.Json.Serialization.JsonPropertyName("thought")] - public bool? Thought { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("codeExecutionResult")] + public global::Google.Gemini.CodeExecutionResult? CodeExecutionResult { get; set; } /// - /// URI based data. + /// A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. /// - [global::System.Text.Json.Serialization.JsonPropertyName("fileData")] - public global::Google.Gemini.FileData? FileData { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("toolCall")] + public global::Google.Gemini.ToolCall? ToolCall { get; set; } /// - /// Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated. + /// Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. /// - [global::System.Text.Json.Serialization.JsonPropertyName("executableCode")] - public global::Google.Gemini.ExecutableCode? ExecutableCode { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("partMetadata")] + public object? PartMetadata { get; set; } /// - /// Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used. + /// URI based data. /// - [global::System.Text.Json.Serialization.JsonPropertyName("codeExecutionResult")] - public global::Google.Gemini.CodeExecutionResult? CodeExecutionResult { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("fileData")] + public global::Google.Gemini.FileData? FileData { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -98,71 +98,71 @@ public sealed partial class Part /// /// Initializes a new instance of the class. /// - /// - /// A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values. - /// - /// - /// The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction. - /// - /// - /// A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. - /// - /// - /// Raw media bytes. Text should not be sent as raw bytes, use the 'text' field. - /// - /// - /// Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. - /// - /// - /// Inline text. + /// + /// The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. /// /// /// Optional. An opaque signature for the thought so it can be reused in subsequent requests. /// - /// - /// The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. + /// + /// Inline text. /// /// /// Optional. Indicates if the part is thought from the model. /// - /// - /// URI based data. + /// + /// A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values. /// /// /// Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated. /// + /// + /// Raw media bytes. Text should not be sent as raw bytes, use the 'text' field. + /// + /// + /// The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction. + /// /// /// Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used. /// + /// + /// A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. + /// + /// + /// Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. + /// + /// + /// URI based data. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Part( + global::Google.Gemini.ToolResponse? toolResponse, + byte[]? thoughtSignature, + string? text, + bool? thought, global::Google.Gemini.FunctionCall? functionCall, + global::Google.Gemini.ExecutableCode? executableCode, + global::Google.Gemini.Blob? inlineData, global::Google.Gemini.FunctionResponse? functionResponse, + global::Google.Gemini.CodeExecutionResult? codeExecutionResult, global::Google.Gemini.ToolCall? toolCall, - global::Google.Gemini.Blob? inlineData, object? partMetadata, - string? text, - byte[]? thoughtSignature, - global::Google.Gemini.ToolResponse? toolResponse, - bool? thought, - global::Google.Gemini.FileData? fileData, - global::Google.Gemini.ExecutableCode? executableCode, - global::Google.Gemini.CodeExecutionResult? codeExecutionResult) + global::Google.Gemini.FileData? fileData) { + this.ToolResponse = toolResponse; + this.ThoughtSignature = thoughtSignature; + this.Text = text; + this.Thought = thought; this.FunctionCall = functionCall; + this.ExecutableCode = executableCode; + this.InlineData = inlineData; this.FunctionResponse = functionResponse; + this.CodeExecutionResult = codeExecutionResult; this.ToolCall = toolCall; - this.InlineData = inlineData; this.PartMetadata = partMetadata; - this.Text = text; - this.ThoughtSignature = thoughtSignature; - this.ToolResponse = toolResponse; - this.Thought = thought; this.FileData = fileData; - this.ExecutableCode = executableCode; - this.CodeExecutionResult = codeExecutionResult; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Permission.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Permission.g.cs index be7e5da83..9a41c0152 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Permission.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Permission.g.cs @@ -15,13 +15,6 @@ public sealed partial class Permission [global::System.Text.Json.Serialization.JsonPropertyName("name")] public string? Name { get; set; } - /// - /// Required. The role granted by this permission. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.PermissionRoleJsonConverter))] - public global::Google.Gemini.PermissionRole? Role { get; set; } - /// /// Optional. Immutable. The type of the grantee. /// @@ -35,6 +28,13 @@ public sealed partial class Permission [global::System.Text.Json.Serialization.JsonPropertyName("emailAddress")] public string? EmailAddress { get; set; } + /// + /// Required. The role granted by this permission. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.PermissionRoleJsonConverter))] + public global::Google.Gemini.PermissionRole? Role { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -48,28 +48,28 @@ public sealed partial class Permission /// Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.
/// Included only in responses /// - /// - /// Required. The role granted by this permission. - /// /// /// Optional. Immutable. The type of the grantee. /// /// /// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE. /// + /// + /// Required. The role granted by this permission. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Permission( string? name, - global::Google.Gemini.PermissionRole? role, global::Google.Gemini.PermissionGranteeType? granteeType, - string? emailAddress) + string? emailAddress, + global::Google.Gemini.PermissionRole? role) { this.Name = name; - this.Role = role; this.GranteeType = granteeType; this.EmailAddress = emailAddress; + this.Role = role; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievalConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievalConfig.g.cs index 3dcf1c7b7..1d723d03b 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievalConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievalConfig.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class RetrievalConfig { - /// - /// Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("languageCode")] - public string? LanguageCode { get; set; } - /// /// An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. /// [global::System.Text.Json.Serialization.JsonPropertyName("latLng")] public global::Google.Gemini.LatLng? LatLng { get; set; } + /// + /// Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("languageCode")] + public string? LanguageCode { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -29,21 +29,21 @@ public sealed partial class RetrievalConfig /// /// Initializes a new instance of the class. /// - /// - /// Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - /// /// /// An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. /// + /// + /// Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RetrievalConfig( - string? languageCode, - global::Google.Gemini.LatLng? latLng) + global::Google.Gemini.LatLng? latLng, + string? languageCode) { - this.LanguageCode = languageCode; this.LatLng = latLng; + this.LanguageCode = languageCode; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievedContext.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievedContext.g.cs index bdf527279..3e0bf95e4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievedContext.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.RetrievedContext.g.cs @@ -15,10 +15,10 @@ public sealed partial class RetrievedContext public string? Uri { get; set; } /// - /// Optional. Title of the document. + /// Optional. Text of the chunk. /// - [global::System.Text.Json.Serialization.JsonPropertyName("title")] - public string? Title { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + public string? Text { get; set; } /// /// Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id} @@ -27,22 +27,16 @@ public sealed partial class RetrievedContext public string? MediaId { get; set; } /// - /// Optional. User-provided metadata about the retrieved context. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("customMetadata")] - public global::System.Collections.Generic.IList? CustomMetadata { get; set; } - - /// - /// Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123` + /// Optional. Title of the document. /// - [global::System.Text.Json.Serialization.JsonPropertyName("fileSearchStore")] - public string? FileSearchStore { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("title")] + public string? Title { get; set; } /// - /// Optional. Text of the chunk. + /// Optional. User-provided metadata about the retrieved context. /// - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - public string? Text { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("customMetadata")] + public global::System.Collections.Generic.IList? CustomMetadata { get; set; } /// /// Optional. Page number of the retrieved context, if applicable. @@ -50,6 +44,12 @@ public sealed partial class RetrievedContext [global::System.Text.Json.Serialization.JsonPropertyName("pageNumber")] public int? PageNumber { get; set; } + /// + /// Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123` + /// + [global::System.Text.Json.Serialization.JsonPropertyName("fileSearchStore")] + public string? FileSearchStore { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -62,43 +62,43 @@ public sealed partial class RetrievedContext /// /// Optional. URI reference of the semantic retrieval document. /// - /// - /// Optional. Title of the document. + /// + /// Optional. Text of the chunk. /// /// /// Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id} /// + /// + /// Optional. Title of the document. + /// /// /// Optional. User-provided metadata about the retrieved context. /// - /// - /// Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123` - /// - /// - /// Optional. Text of the chunk. - /// /// /// Optional. Page number of the retrieved context, if applicable. /// + /// + /// Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123` + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RetrievedContext( string? uri, - string? title, + string? text, string? mediaId, + string? title, global::System.Collections.Generic.IList? customMetadata, - string? fileSearchStore, - string? text, - int? pageNumber) + int? pageNumber, + string? fileSearchStore) { this.Uri = uri; - this.Title = title; + this.Text = text; this.MediaId = mediaId; + this.Title = title; this.CustomMetadata = customMetadata; - this.FileSearchStore = fileSearchStore; - this.Text = text; this.PageNumber = pageNumber; + this.FileSearchStore = fileSearchStore; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ReviewSnippet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ReviewSnippet.g.cs index a5901673e..dcbe94b62 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ReviewSnippet.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ReviewSnippet.g.cs @@ -9,10 +9,10 @@ namespace Google.Gemini public sealed partial class ReviewSnippet { /// - /// A link that corresponds to the user review on Google Maps. + /// The ID of the review snippet. /// - [global::System.Text.Json.Serialization.JsonPropertyName("googleMapsUri")] - public string? GoogleMapsUri { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("reviewId")] + public string? ReviewId { get; set; } /// /// Title of the review. @@ -21,10 +21,10 @@ public sealed partial class ReviewSnippet public string? Title { get; set; } /// - /// The ID of the review snippet. + /// A link that corresponds to the user review on Google Maps. /// - [global::System.Text.Json.Serialization.JsonPropertyName("reviewId")] - public string? ReviewId { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("googleMapsUri")] + public string? GoogleMapsUri { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -35,26 +35,26 @@ public sealed partial class ReviewSnippet /// /// Initializes a new instance of the class. /// - /// - /// A link that corresponds to the user review on Google Maps. + /// + /// The ID of the review snippet. /// /// /// Title of the review. /// - /// - /// The ID of the review snippet. + /// + /// A link that corresponds to the user review on Google Maps. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ReviewSnippet( - string? googleMapsUri, + string? reviewId, string? title, - string? reviewId) + string? googleMapsUri) { - this.GoogleMapsUri = googleMapsUri; - this.Title = title; this.ReviewId = reviewId; + this.Title = title; + this.GoogleMapsUri = googleMapsUri; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SafetyRating.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SafetyRating.g.cs index d173960d9..4d10712f5 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SafetyRating.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SafetyRating.g.cs @@ -8,13 +8,6 @@ namespace Google.Gemini /// public sealed partial class SafetyRating { - /// - /// Required. The category for this rating. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("category")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.SafetyRatingCategoryJsonConverter))] - public global::Google.Gemini.SafetyRatingCategory? Category { get; set; } - /// /// Required. The probability of harm for this content. /// @@ -28,6 +21,13 @@ public sealed partial class SafetyRating [global::System.Text.Json.Serialization.JsonPropertyName("blocked")] public bool? Blocked { get; set; } + /// + /// Required. The category for this rating. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("category")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.SafetyRatingCategoryJsonConverter))] + public global::Google.Gemini.SafetyRatingCategory? Category { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -37,26 +37,26 @@ public sealed partial class SafetyRating /// /// Initializes a new instance of the class. /// - /// - /// Required. The category for this rating. - /// /// /// Required. The probability of harm for this content. /// /// /// Was this content blocked because of this rating? /// + /// + /// Required. The category for this rating. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public SafetyRating( - global::Google.Gemini.SafetyRatingCategory? category, global::Google.Gemini.SafetyRatingProbability? probability, - bool? blocked) + bool? blocked, + global::Google.Gemini.SafetyRatingCategory? category) { - this.Category = category; this.Probability = probability; this.Blocked = blocked; + this.Category = category; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Schema.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Schema.g.cs index 270bcbb1c..bc4b74b9c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Schema.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Schema.g.cs @@ -9,46 +9,52 @@ namespace Google.Gemini public sealed partial class Schema { /// - /// Optional. Properties of Type.OBJECT. + /// Optional. Indicates if the value may be null. /// - [global::System.Text.Json.Serialization.JsonPropertyName("properties")] - public global::System.Collections.Generic.Dictionary? Properties { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("nullable")] + public bool? Nullable { get; set; } /// - /// Optional. The value should be validated against any (one or more) of the subschemas in the list. + /// Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response. /// - [global::System.Text.Json.Serialization.JsonPropertyName("anyOf")] - public global::System.Collections.Generic.IList? AnyOf { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("propertyOrdering")] + public global::System.Collections.Generic.IList? PropertyOrdering { get; set; } /// - /// Optional. Maximum number of the properties for Type.OBJECT. + /// Optional. Maximum number of the elements for Type.ARRAY. /// - [global::System.Text.Json.Serialization.JsonPropertyName("maxProperties")] - public string? MaxProperties { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("maxItems")] + public string? MaxItems { get; set; } /// - /// Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality. + /// Optional. Required properties of Type.OBJECT. /// - [global::System.Text.Json.Serialization.JsonPropertyName("format")] - public string? Format { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("required")] + public global::System.Collections.Generic.IList? Required { get; set; } /// - /// Optional. Pattern of the Type.STRING to restrict a string to a regular expression. + /// Optional. Example of the object. Will only populated when the object is the root. /// - [global::System.Text.Json.Serialization.JsonPropertyName("pattern")] - public string? Pattern { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("example")] + public object? Example { get; set; } /// - /// Optional. The title of the schema. + /// Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors. /// - [global::System.Text.Json.Serialization.JsonPropertyName("title")] - public string? Title { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("default")] + public object? Default { get; set; } /// - /// Optional. Maximum number of the elements for Type.ARRAY. + /// Optional. Properties of Type.OBJECT. /// - [global::System.Text.Json.Serialization.JsonPropertyName("maxItems")] - public string? MaxItems { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("properties")] + public global::System.Collections.Generic.Dictionary? Properties { get; set; } + + /// + /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("items")] + public global::Google.Gemini.Schema? Items { get; set; } /// /// Optional. Minimum number of the properties for Type.OBJECT. @@ -57,10 +63,10 @@ public sealed partial class Schema public string? MinProperties { get; set; } /// - /// Optional. Maximum length of the Type.STRING + /// Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING /// - [global::System.Text.Json.Serialization.JsonPropertyName("maxLength")] - public string? MaxLength { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("minLength")] + public string? MinLength { get; set; } /// /// Required. Data type. @@ -70,28 +76,28 @@ public sealed partial class Schema public global::Google.Gemini.SchemaType? Type { get; set; } /// - /// Optional. Minimum number of the elements for Type.ARRAY. + /// Optional. The title of the schema. /// - [global::System.Text.Json.Serialization.JsonPropertyName("minItems")] - public string? MinItems { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("title")] + public string? Title { get; set; } /// - /// Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING + /// Optional. Minimum number of the elements for Type.ARRAY. /// - [global::System.Text.Json.Serialization.JsonPropertyName("minLength")] - public string? MinLength { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("minItems")] + public string? MinItems { get; set; } /// - /// Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors. + /// Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER /// - [global::System.Text.Json.Serialization.JsonPropertyName("default")] - public object? Default { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("minimum")] + public double? Minimum { get; set; } /// - /// Optional. Indicates if the value may be null. + /// Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality. /// - [global::System.Text.Json.Serialization.JsonPropertyName("nullable")] - public bool? Nullable { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("format")] + public string? Format { get; set; } /// /// Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown. @@ -100,46 +106,40 @@ public sealed partial class Schema public string? Description { get; set; } /// - /// Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enum")] - public global::System.Collections.Generic.IList? Enum { get; set; } - - /// - /// Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response. + /// Optional. Maximum number of the properties for Type.OBJECT. /// - [global::System.Text.Json.Serialization.JsonPropertyName("propertyOrdering")] - public global::System.Collections.Generic.IList? PropertyOrdering { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("maxProperties")] + public string? MaxProperties { get; set; } /// - /// Optional. Required properties of Type.OBJECT. + /// Optional. Maximum value of the Type.INTEGER and Type.NUMBER /// - [global::System.Text.Json.Serialization.JsonPropertyName("required")] - public global::System.Collections.Generic.IList? Required { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("maximum")] + public double? Maximum { get; set; } /// - /// Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER + /// Optional. Maximum length of the Type.STRING /// - [global::System.Text.Json.Serialization.JsonPropertyName("minimum")] - public double? Minimum { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("maxLength")] + public string? MaxLength { get; set; } /// - /// Optional. Maximum value of the Type.INTEGER and Type.NUMBER + /// Optional. The value should be validated against any (one or more) of the subschemas in the list. /// - [global::System.Text.Json.Serialization.JsonPropertyName("maximum")] - public double? Maximum { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("anyOf")] + public global::System.Collections.Generic.IList? AnyOf { get; set; } /// - /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). + /// Optional. Pattern of the Type.STRING to restrict a string to a regular expression. /// - [global::System.Text.Json.Serialization.JsonPropertyName("items")] - public global::Google.Gemini.Schema? Items { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("pattern")] + public string? Pattern { get; set; } /// - /// Optional. Example of the object. Will only populated when the object is the root. + /// Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} /// - [global::System.Text.Json.Serialization.JsonPropertyName("example")] - public object? Example { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("enum")] + public global::System.Collections.Generic.IList? Enum { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -150,121 +150,121 @@ public sealed partial class Schema /// /// Initializes a new instance of the class. /// - /// - /// Optional. Properties of Type.OBJECT. + /// + /// Optional. Indicates if the value may be null. /// - /// - /// Optional. The value should be validated against any (one or more) of the subschemas in the list. + /// + /// Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response. /// - /// - /// Optional. Maximum number of the properties for Type.OBJECT. + /// + /// Optional. Maximum number of the elements for Type.ARRAY. /// - /// - /// Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality. + /// + /// Optional. Required properties of Type.OBJECT. /// - /// - /// Optional. Pattern of the Type.STRING to restrict a string to a regular expression. + /// + /// Optional. Example of the object. Will only populated when the object is the root. /// - /// - /// Optional. The title of the schema. + /// + /// Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors. /// - /// - /// Optional. Maximum number of the elements for Type.ARRAY. + /// + /// Optional. Properties of Type.OBJECT. + /// + /// + /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). /// /// /// Optional. Minimum number of the properties for Type.OBJECT. /// - /// - /// Optional. Maximum length of the Type.STRING + /// + /// Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING /// /// /// Required. Data type. /// + /// + /// Optional. The title of the schema. + /// /// /// Optional. Minimum number of the elements for Type.ARRAY. /// - /// - /// Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING - /// - /// - /// Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors. + /// + /// Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER /// - /// - /// Optional. Indicates if the value may be null. + /// + /// Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality. /// /// /// Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown. /// - /// - /// Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} - /// - /// - /// Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response. - /// - /// - /// Optional. Required properties of Type.OBJECT. - /// - /// - /// Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER + /// + /// Optional. Maximum number of the properties for Type.OBJECT. /// /// /// Optional. Maximum value of the Type.INTEGER and Type.NUMBER /// - /// - /// The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). + /// + /// Optional. Maximum length of the Type.STRING /// - /// - /// Optional. Example of the object. Will only populated when the object is the root. + /// + /// Optional. The value should be validated against any (one or more) of the subschemas in the list. + /// + /// + /// Optional. Pattern of the Type.STRING to restrict a string to a regular expression. + /// + /// + /// Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Schema( - global::System.Collections.Generic.Dictionary? properties, - global::System.Collections.Generic.IList? anyOf, - string? maxProperties, - string? format, - string? pattern, - string? title, + bool? nullable, + global::System.Collections.Generic.IList? propertyOrdering, string? maxItems, + global::System.Collections.Generic.IList? required, + object? example, + object? @default, + global::System.Collections.Generic.Dictionary? properties, + global::Google.Gemini.Schema? items, string? minProperties, - string? maxLength, + string? minLength, global::Google.Gemini.SchemaType? type, + string? title, string? minItems, - string? minLength, - object? @default, - bool? nullable, - string? description, - global::System.Collections.Generic.IList? @enum, - global::System.Collections.Generic.IList? propertyOrdering, - global::System.Collections.Generic.IList? required, double? minimum, + string? format, + string? description, + string? maxProperties, double? maximum, - global::Google.Gemini.Schema? items, - object? example) + string? maxLength, + global::System.Collections.Generic.IList? anyOf, + string? pattern, + global::System.Collections.Generic.IList? @enum) { - this.Properties = properties; - this.AnyOf = anyOf; - this.MaxProperties = maxProperties; - this.Format = format; - this.Pattern = pattern; - this.Title = title; + this.Nullable = nullable; + this.PropertyOrdering = propertyOrdering; this.MaxItems = maxItems; + this.Required = required; + this.Example = example; + this.Default = @default; + this.Properties = properties; + this.Items = items; this.MinProperties = minProperties; - this.MaxLength = maxLength; + this.MinLength = minLength; this.Type = type; + this.Title = title; this.MinItems = minItems; - this.MinLength = minLength; - this.Default = @default; - this.Nullable = nullable; - this.Description = description; - this.Enum = @enum; - this.PropertyOrdering = propertyOrdering; - this.Required = required; this.Minimum = minimum; + this.Format = format; + this.Description = description; + this.MaxProperties = maxProperties; this.Maximum = maximum; - this.Items = items; - this.Example = example; + this.MaxLength = maxLength; + this.AnyOf = anyOf; + this.Pattern = pattern; + this.Enum = @enum; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeakerVoiceConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeakerVoiceConfig.g.cs index f1ef065a1..370880fa8 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeakerVoiceConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeakerVoiceConfig.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class SpeakerVoiceConfig { - /// - /// Required. The name of the speaker to use. Should be the same as in the prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("speaker")] - public string? Speaker { get; set; } - /// /// The configuration for the voice to use. /// [global::System.Text.Json.Serialization.JsonPropertyName("voiceConfig")] public global::Google.Gemini.VoiceConfig? VoiceConfig { get; set; } + /// + /// Required. The name of the speaker to use. Should be the same as in the prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("speaker")] + public string? Speaker { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -29,21 +29,21 @@ public sealed partial class SpeakerVoiceConfig /// /// Initializes a new instance of the class. /// - /// - /// Required. The name of the speaker to use. Should be the same as in the prompt. - /// /// /// The configuration for the voice to use. /// + /// + /// Required. The name of the speaker to use. Should be the same as in the prompt. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public SpeakerVoiceConfig( - string? speaker, - global::Google.Gemini.VoiceConfig? voiceConfig) + global::Google.Gemini.VoiceConfig? voiceConfig, + string? speaker) { - this.Speaker = speaker; this.VoiceConfig = voiceConfig; + this.Speaker = speaker; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeechConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeechConfig.g.cs index c86475b3f..3c8418594 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeechConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.SpeechConfig.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class SpeechConfig { - /// - /// Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("languageCode")] - public string? LanguageCode { get; set; } - /// /// The configuration for the multi-speaker setup. /// @@ -26,6 +20,12 @@ public sealed partial class SpeechConfig [global::System.Text.Json.Serialization.JsonPropertyName("voiceConfig")] public global::Google.Gemini.VoiceConfig? VoiceConfig { get; set; } + /// + /// Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("languageCode")] + public string? LanguageCode { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -35,26 +35,26 @@ public sealed partial class SpeechConfig /// /// Initializes a new instance of the class. /// - /// - /// Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`. - /// /// /// The configuration for the multi-speaker setup. /// /// /// The configuration for the voice to use. /// + /// + /// Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public SpeechConfig( - string? languageCode, global::Google.Gemini.MultiSpeakerVoiceConfig? multiSpeakerVoiceConfig, - global::Google.Gemini.VoiceConfig? voiceConfig) + global::Google.Gemini.VoiceConfig? voiceConfig, + string? languageCode) { - this.LanguageCode = languageCode; this.MultiSpeakerVoiceConfig = multiSpeakerVoiceConfig; this.VoiceConfig = voiceConfig; + this.LanguageCode = languageCode; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Status.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Status.g.cs index a5a169785..08b874895 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Status.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Status.g.cs @@ -9,10 +9,10 @@ namespace Google.Gemini public sealed partial class Status { /// - /// A list of messages that carry the error details. There is a common set of message types for APIs to use. + /// The status code, which should be an enum value of google.rpc.Code. /// - [global::System.Text.Json.Serialization.JsonPropertyName("details")] - public global::System.Collections.Generic.IList? Details { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + public int? Code { get; set; } /// /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. @@ -21,10 +21,10 @@ public sealed partial class Status public string? Message { get; set; } /// - /// The status code, which should be an enum value of google.rpc.Code. + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. /// - [global::System.Text.Json.Serialization.JsonPropertyName("code")] - public int? Code { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("details")] + public global::System.Collections.Generic.IList? Details { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -35,26 +35,26 @@ public sealed partial class Status /// /// Initializes a new instance of the class. /// - /// - /// A list of messages that carry the error details. There is a common set of message types for APIs to use. + /// + /// The status code, which should be an enum value of google.rpc.Code. /// /// /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. /// - /// - /// The status code, which should be an enum value of google.rpc.Code. + /// + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Status( - global::System.Collections.Generic.IList? details, + int? code, string? message, - int? code) + global::System.Collections.Generic.IList? details) { - this.Details = details; - this.Message = message; this.Code = code; + this.Message = message; + this.Details = details; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.StreamableHttpTransport.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.StreamableHttpTransport.g.cs index 82937c3ed..4ae8ae8a1 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.StreamableHttpTransport.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.StreamableHttpTransport.g.cs @@ -9,16 +9,10 @@ namespace Google.Gemini public sealed partial class StreamableHttpTransport { /// - /// Optional: Fields for authentication headers, timeouts, etc., if needed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("headers")] - public global::System.Collections.Generic.Dictionary? Headers { get; set; } - - /// - /// Timeout for SSE read operations. + /// HTTP timeout for regular operations. /// - [global::System.Text.Json.Serialization.JsonPropertyName("sseReadTimeout")] - public string? SseReadTimeout { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("timeout")] + public string? Timeout { get; set; } /// /// Whether to close the client session when the transport closes. @@ -26,18 +20,24 @@ public sealed partial class StreamableHttpTransport [global::System.Text.Json.Serialization.JsonPropertyName("terminateOnClose")] public bool? TerminateOnClose { get; set; } - /// - /// HTTP timeout for regular operations. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("timeout")] - public string? Timeout { get; set; } - /// /// The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp" /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] public string? Url { get; set; } + /// + /// Optional: Fields for authentication headers, timeouts, etc., if needed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("headers")] + public global::System.Collections.Generic.Dictionary? Headers { get; set; } + + /// + /// Timeout for SSE read operations. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sseReadTimeout")] + public string? SseReadTimeout { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -47,36 +47,36 @@ public sealed partial class StreamableHttpTransport /// /// Initializes a new instance of the class. /// - /// - /// Optional: Fields for authentication headers, timeouts, etc., if needed. - /// - /// - /// Timeout for SSE read operations. + /// + /// HTTP timeout for regular operations. /// /// /// Whether to close the client session when the transport closes. /// - /// - /// HTTP timeout for regular operations. - /// /// /// The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp" /// + /// + /// Optional: Fields for authentication headers, timeouts, etc., if needed. + /// + /// + /// Timeout for SSE read operations. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public StreamableHttpTransport( - global::System.Collections.Generic.Dictionary? headers, - string? sseReadTimeout, - bool? terminateOnClose, string? timeout, - string? url) + bool? terminateOnClose, + string? url, + global::System.Collections.Generic.Dictionary? headers, + string? sseReadTimeout) { - this.Headers = headers; - this.SseReadTimeout = sseReadTimeout; - this.TerminateOnClose = terminateOnClose; this.Timeout = timeout; + this.TerminateOnClose = terminateOnClose; this.Url = url; + this.Headers = headers; + this.SseReadTimeout = sseReadTimeout; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ThinkingConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ThinkingConfig.g.cs index 01916fe4a..45dec48f4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ThinkingConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ThinkingConfig.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class ThinkingConfig { - /// - /// Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("includeThoughts")] - public bool? IncludeThoughts { get; set; } - /// /// The number of thoughts tokens that the model should generate. /// @@ -27,6 +21,12 @@ public sealed partial class ThinkingConfig [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.ThinkingConfigThinkingLevelJsonConverter))] public global::Google.Gemini.ThinkingConfigThinkingLevel? ThinkingLevel { get; set; } + /// + /// Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("includeThoughts")] + public bool? IncludeThoughts { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -36,26 +36,26 @@ public sealed partial class ThinkingConfig /// /// Initializes a new instance of the class. /// - /// - /// Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. - /// /// /// The number of thoughts tokens that the model should generate. /// /// /// Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error. /// + /// + /// Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ThinkingConfig( - bool? includeThoughts, int? thinkingBudget, - global::Google.Gemini.ThinkingConfigThinkingLevel? thinkingLevel) + global::Google.Gemini.ThinkingConfigThinkingLevel? thinkingLevel, + bool? includeThoughts) { - this.IncludeThoughts = includeThoughts; this.ThinkingBudget = thinkingBudget; this.ThinkingLevel = thinkingLevel; + this.IncludeThoughts = includeThoughts; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Tool.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Tool.g.cs index 7357bc727..34c513e94 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Tool.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Tool.g.cs @@ -9,58 +9,58 @@ namespace Google.Gemini public sealed partial class Tool { /// - /// Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn. + /// Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool. /// - [global::System.Text.Json.Serialization.JsonPropertyName("functionDeclarations")] - public global::System.Collections.Generic.IList? FunctionDeclarations { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("codeExecution")] + public global::Google.Gemini.CodeExecution? CodeExecution { get; set; } /// - /// Tool to retrieve public web data for grounding, powered by Google. + /// Computer Use tool type. /// - [global::System.Text.Json.Serialization.JsonPropertyName("googleSearchRetrieval")] - public global::Google.Gemini.GoogleSearchRetrieval? GoogleSearchRetrieval { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("computerUse")] + public global::Google.Gemini.ComputerUse? ComputerUse { get; set; } /// - /// Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool. + /// The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. /// - [global::System.Text.Json.Serialization.JsonPropertyName("codeExecution")] - public global::Google.Gemini.CodeExecution? CodeExecution { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("fileSearch")] + public global::Google.Gemini.FileSearch? FileSearch { get; set; } /// - /// GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. + /// The GoogleMaps Tool that provides geospatial context for the user's query. /// - [global::System.Text.Json.Serialization.JsonPropertyName("googleSearch")] - public global::Google.Gemini.GoogleSearch? GoogleSearch { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("googleMaps")] + public global::Google.Gemini.GoogleMaps? GoogleMaps { get; set; } /// - /// Computer Use tool type. + /// Tool to retrieve public web data for grounding, powered by Google. /// - [global::System.Text.Json.Serialization.JsonPropertyName("computerUse")] - public global::Google.Gemini.ComputerUse? ComputerUse { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("googleSearchRetrieval")] + public global::Google.Gemini.GoogleSearchRetrieval? GoogleSearchRetrieval { get; set; } /// - /// Optional. MCP Servers to connect to. + /// GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. /// - [global::System.Text.Json.Serialization.JsonPropertyName("mcpServers")] - public global::System.Collections.Generic.IList? McpServers { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("googleSearch")] + public global::Google.Gemini.GoogleSearch? GoogleSearch { get; set; } /// - /// Tool to support URL context retrieval. + /// Optional. MCP Servers to connect to. /// - [global::System.Text.Json.Serialization.JsonPropertyName("urlContext")] - public global::Google.Gemini.UrlContext? UrlContext { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("mcpServers")] + public global::System.Collections.Generic.IList? McpServers { get; set; } /// - /// The GoogleMaps Tool that provides geospatial context for the user's query. + /// Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn. /// - [global::System.Text.Json.Serialization.JsonPropertyName("googleMaps")] - public global::Google.Gemini.GoogleMaps? GoogleMaps { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("functionDeclarations")] + public global::System.Collections.Generic.IList? FunctionDeclarations { get; set; } /// - /// The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. + /// Tool to support URL context retrieval. /// - [global::System.Text.Json.Serialization.JsonPropertyName("fileSearch")] - public global::Google.Gemini.FileSearch? FileSearch { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("urlContext")] + public global::Google.Gemini.UrlContext? UrlContext { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -71,56 +71,56 @@ public sealed partial class Tool /// /// Initializes a new instance of the class. /// - /// - /// Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn. + /// + /// Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool. + /// + /// + /// Computer Use tool type. + /// + /// + /// The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. + /// + /// + /// The GoogleMaps Tool that provides geospatial context for the user's query. /// /// /// Tool to retrieve public web data for grounding, powered by Google. /// - /// - /// Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool. - /// /// /// GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. /// - /// - /// Computer Use tool type. - /// /// /// Optional. MCP Servers to connect to. /// + /// + /// Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn. + /// /// /// Tool to support URL context retrieval. /// - /// - /// The GoogleMaps Tool that provides geospatial context for the user's query. - /// - /// - /// The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Tool( - global::System.Collections.Generic.IList? functionDeclarations, - global::Google.Gemini.GoogleSearchRetrieval? googleSearchRetrieval, global::Google.Gemini.CodeExecution? codeExecution, - global::Google.Gemini.GoogleSearch? googleSearch, global::Google.Gemini.ComputerUse? computerUse, - global::System.Collections.Generic.IList? mcpServers, - global::Google.Gemini.UrlContext? urlContext, + global::Google.Gemini.FileSearch? fileSearch, global::Google.Gemini.GoogleMaps? googleMaps, - global::Google.Gemini.FileSearch? fileSearch) + global::Google.Gemini.GoogleSearchRetrieval? googleSearchRetrieval, + global::Google.Gemini.GoogleSearch? googleSearch, + global::System.Collections.Generic.IList? mcpServers, + global::System.Collections.Generic.IList? functionDeclarations, + global::Google.Gemini.UrlContext? urlContext) { - this.FunctionDeclarations = functionDeclarations; - this.GoogleSearchRetrieval = googleSearchRetrieval; this.CodeExecution = codeExecution; - this.GoogleSearch = googleSearch; this.ComputerUse = computerUse; + this.FileSearch = fileSearch; + this.GoogleMaps = googleMaps; + this.GoogleSearchRetrieval = googleSearchRetrieval; + this.GoogleSearch = googleSearch; this.McpServers = mcpServers; + this.FunctionDeclarations = functionDeclarations; this.UrlContext = urlContext; - this.GoogleMaps = googleMaps; - this.FileSearch = fileSearch; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolCall.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolCall.g.cs index ae223c63a..4fcef779c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolCall.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolCall.g.cs @@ -14,6 +14,12 @@ public sealed partial class ToolCall [global::System.Text.Json.Serialization.JsonPropertyName("args")] public object? Args { get; set; } + /// + /// Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + /// /// Required. The type of tool that was called. /// @@ -21,12 +27,6 @@ public sealed partial class ToolCall [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.ToolCallToolTypeJsonConverter))] public global::Google.Gemini.ToolCallToolType? ToolType { get; set; } - /// - /// Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - public string? Id { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -39,23 +39,23 @@ public sealed partial class ToolCall /// /// Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...} /// - /// - /// Required. The type of tool that was called. - /// /// /// Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`. /// + /// + /// Required. The type of tool that was called. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ToolCall( object? args, - global::Google.Gemini.ToolCallToolType? toolType, - string? id) + string? id, + global::Google.Gemini.ToolCallToolType? toolType) { this.Args = args; - this.ToolType = toolType; this.Id = id; + this.ToolType = toolType; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolConfig.g.cs index ba6504675..40f9f938e 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolConfig.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class ToolConfig { - /// - /// Configuration for specifying function calling behavior. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("functionCallingConfig")] - public global::Google.Gemini.FunctionCallingConfig? FunctionCallingConfig { get; set; } - /// /// Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions. /// @@ -26,6 +20,12 @@ public sealed partial class ToolConfig [global::System.Text.Json.Serialization.JsonPropertyName("retrievalConfig")] public global::Google.Gemini.RetrievalConfig? RetrievalConfig { get; set; } + /// + /// Configuration for specifying function calling behavior. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("functionCallingConfig")] + public global::Google.Gemini.FunctionCallingConfig? FunctionCallingConfig { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -35,26 +35,26 @@ public sealed partial class ToolConfig /// /// Initializes a new instance of the class. /// - /// - /// Configuration for specifying function calling behavior. - /// /// /// Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions. /// /// /// Retrieval config. /// + /// + /// Configuration for specifying function calling behavior. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ToolConfig( - global::Google.Gemini.FunctionCallingConfig? functionCallingConfig, bool? includeServerSideToolInvocations, - global::Google.Gemini.RetrievalConfig? retrievalConfig) + global::Google.Gemini.RetrievalConfig? retrievalConfig, + global::Google.Gemini.FunctionCallingConfig? functionCallingConfig) { - this.FunctionCallingConfig = functionCallingConfig; this.IncludeServerSideToolInvocations = includeServerSideToolInvocations; this.RetrievalConfig = retrievalConfig; + this.FunctionCallingConfig = functionCallingConfig; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolResponse.g.cs index 1a5f51ecc..f67a9ee88 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolResponse.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.ToolResponse.g.cs @@ -9,11 +9,10 @@ namespace Google.Gemini public sealed partial class ToolResponse { /// - /// Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`. + /// Optional. The tool response. /// - [global::System.Text.Json.Serialization.JsonPropertyName("toolType")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.ToolResponseToolTypeJsonConverter))] - public global::Google.Gemini.ToolResponseToolType? ToolType { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("response")] + public object? Response { get; set; } /// /// Optional. The identifier of the tool call this response is for. @@ -22,10 +21,11 @@ public sealed partial class ToolResponse public string? Id { get; set; } /// - /// Optional. The tool response. + /// Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`. /// - [global::System.Text.Json.Serialization.JsonPropertyName("response")] - public object? Response { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("toolType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.ToolResponseToolTypeJsonConverter))] + public global::Google.Gemini.ToolResponseToolType? ToolType { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -36,26 +36,26 @@ public sealed partial class ToolResponse /// /// Initializes a new instance of the class. /// - /// - /// Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`. + /// + /// Optional. The tool response. /// /// /// Optional. The identifier of the tool call this response is for. /// - /// - /// Optional. The tool response. + /// + /// Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ToolResponse( - global::Google.Gemini.ToolResponseToolType? toolType, + object? response, string? id, - object? response) + global::Google.Gemini.ToolResponseToolType? toolType) { - this.ToolType = toolType; - this.Id = id; this.Response = response; + this.Id = id; + this.ToolType = toolType; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TunedModel.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TunedModel.g.cs index 021c9db27..d7d9e74b9 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TunedModel.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TunedModel.g.cs @@ -8,26 +8,6 @@ namespace Google.Gemini /// public sealed partial class TunedModel { - /// - /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] - public string? DisplayName { get; set; } - - /// - /// Output only. The state of the tuned model.
- /// Included only in responses - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("state")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.TunedModelStateJsonConverter))] - public global::Google.Gemini.TunedModelState? State { get; set; } - - /// - /// Optional. List of project numbers that have read access to the tuned model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("readerProjectNumbers")] - public global::System.Collections.Generic.IList? ReaderProjectNumbers { get; set; } - /// /// Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model. /// @@ -35,16 +15,16 @@ public sealed partial class TunedModel public float? TopP { get; set; } /// - /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// Optional. A short description of this model. /// - [global::System.Text.Json.Serialization.JsonPropertyName("topK")] - public int? TopK { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } /// - /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. + /// Tuning tasks that create tuned models. /// - [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("tuningTask")] + public global::Google.Gemini.TuningTask? TuningTask { get; set; } /// /// Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`
@@ -54,10 +34,25 @@ public sealed partial class TunedModel public string? Name { get; set; } /// - /// Tuning tasks that create tuned models. + /// Tuned model as a source for training a new model. /// - [global::System.Text.Json.Serialization.JsonPropertyName("tuningTask")] - public global::Google.Gemini.TuningTask? TuningTask { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("tunedModelSource")] + public global::Google.Gemini.TunedModelSource? TunedModelSource { get; set; } + + /// + /// Output only. The state of the tuned model.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.TunedModelStateJsonConverter))] + public global::Google.Gemini.TunedModelState? State { get; set; } + + /// + /// Output only. The timestamp when this model was created.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] + public string? CreateTime { get; set; } /// /// Output only. The timestamp when this model was updated.
@@ -66,6 +61,12 @@ public sealed partial class TunedModel [global::System.Text.Json.Serialization.JsonPropertyName("updateTime")] public string? UpdateTime { get; set; } + /// + /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("topK")] + public int? TopK { get; set; } + /// /// Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` /// @@ -73,23 +74,22 @@ public sealed partial class TunedModel public string? BaseModel { get; set; } /// - /// Output only. The timestamp when this model was created.
- /// Included only in responses + /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("createTime")] - public string? CreateTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] + public float? Temperature { get; set; } /// - /// Optional. A short description of this model. + /// Optional. List of project numbers that have read access to the tuned model. /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("readerProjectNumbers")] + public global::System.Collections.Generic.IList? ReaderProjectNumbers { get; set; } /// - /// Tuned model as a source for training a new model. + /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. /// - [global::System.Text.Json.Serialization.JsonPropertyName("tunedModelSource")] - public global::Google.Gemini.TunedModelSource? TunedModelSource { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -100,80 +100,80 @@ public sealed partial class TunedModel /// /// Initializes a new instance of the class. /// - /// - /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - /// - /// - /// Output only. The state of the tuned model.
- /// Included only in responses - /// - /// - /// Optional. List of project numbers that have read access to the tuned model. - /// /// /// Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// + /// Optional. A short description of this model. /// - /// - /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. + /// + /// Tuning tasks that create tuned models. /// /// /// Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`
/// Included only in responses /// - /// - /// Tuning tasks that create tuned models. + /// + /// Tuned model as a source for training a new model. + /// + /// + /// Output only. The state of the tuned model.
+ /// Included only in responses + /// + /// + /// Output only. The timestamp when this model was created.
+ /// Included only in responses /// /// /// Output only. The timestamp when this model was updated.
/// Included only in responses /// + /// + /// Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model. + /// /// /// Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` /// - /// - /// Output only. The timestamp when this model was created.
- /// Included only in responses + /// + /// Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model. /// - /// - /// Optional. A short description of this model. + /// + /// Optional. List of project numbers that have read access to the tuned model. /// - /// - /// Tuned model as a source for training a new model. + /// + /// Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public TunedModel( - string? displayName, - global::Google.Gemini.TunedModelState? state, - global::System.Collections.Generic.IList? readerProjectNumbers, float? topP, - int? topK, - float? temperature, - string? name, + string? description, global::Google.Gemini.TuningTask? tuningTask, + string? name, + global::Google.Gemini.TunedModelSource? tunedModelSource, + global::Google.Gemini.TunedModelState? state, + string? createTime, string? updateTime, + int? topK, string? baseModel, - string? createTime, - string? description, - global::Google.Gemini.TunedModelSource? tunedModelSource) + float? temperature, + global::System.Collections.Generic.IList? readerProjectNumbers, + string? displayName) { - this.DisplayName = displayName; - this.State = state; - this.ReaderProjectNumbers = readerProjectNumbers; this.TopP = topP; - this.TopK = topK; - this.Temperature = temperature; - this.Name = name; + this.Description = description; this.TuningTask = tuningTask; + this.Name = name; + this.TunedModelSource = tunedModelSource; + this.State = state; + this.CreateTime = createTime; this.UpdateTime = updateTime; + this.TopK = topK; this.BaseModel = baseModel; - this.CreateTime = createTime; - this.Description = description; - this.TunedModelSource = tunedModelSource; + this.Temperature = temperature; + this.ReaderProjectNumbers = readerProjectNumbers; + this.DisplayName = displayName; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningSnapshot.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningSnapshot.g.cs index 60c4281a2..c17a4118c 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningSnapshot.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningSnapshot.g.cs @@ -9,18 +9,18 @@ namespace Google.Gemini public sealed partial class TuningSnapshot { /// - /// Output only. The mean loss of the training examples for this step.
+ /// Output only. The tuning step.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("meanLoss")] - public float? MeanLoss { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("step")] + public int? Step { get; set; } /// - /// Output only. The timestamp when this metric was computed.
+ /// Output only. The mean loss of the training examples for this step.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("computeTime")] - public string? ComputeTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("meanLoss")] + public float? MeanLoss { get; set; } /// /// Output only. The epoch this step was part of.
@@ -30,11 +30,11 @@ public sealed partial class TuningSnapshot public int? Epoch { get; set; } /// - /// Output only. The tuning step.
+ /// Output only. The timestamp when this metric was computed.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("step")] - public int? Step { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("computeTime")] + public string? ComputeTime { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -45,35 +45,35 @@ public sealed partial class TuningSnapshot /// /// Initializes a new instance of the class. /// - /// - /// Output only. The mean loss of the training examples for this step.
+ /// + /// Output only. The tuning step.
/// Included only in responses /// - /// - /// Output only. The timestamp when this metric was computed.
+ /// + /// Output only. The mean loss of the training examples for this step.
/// Included only in responses /// /// /// Output only. The epoch this step was part of.
/// Included only in responses /// - /// - /// Output only. The tuning step.
+ /// + /// Output only. The timestamp when this metric was computed.
/// Included only in responses /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public TuningSnapshot( + int? step, float? meanLoss, - string? computeTime, int? epoch, - int? step) + string? computeTime) { + this.Step = step; this.MeanLoss = meanLoss; - this.ComputeTime = computeTime; this.Epoch = epoch; - this.Step = step; + this.ComputeTime = computeTime; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningTask.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningTask.g.cs index 72fd1bca3..05c63a0c2 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningTask.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.TuningTask.g.cs @@ -9,37 +9,37 @@ namespace Google.Gemini public sealed partial class TuningTask { /// - /// Dataset for training or validation. + /// Output only. The timestamp when tuning this model started.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("trainingData")] - public global::Google.Gemini.Dataset? TrainingData { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("startTime")] + public string? StartTime { get; set; } /// - /// Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance + /// Output only. Metrics collected during tuning.
+ /// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("hyperparameters")] - public global::Google.Gemini.Hyperparameters? Hyperparameters { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("snapshots")] + public global::System.Collections.Generic.IList? Snapshots { get; set; } /// - /// Output only. The timestamp when tuning this model completed.
- /// Included only in responses + /// Dataset for training or validation. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("completeTime")] - public string? CompleteTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("trainingData")] + public global::Google.Gemini.Dataset? TrainingData { get; set; } /// - /// Output only. The timestamp when tuning this model started.
+ /// Output only. The timestamp when tuning this model completed.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("startTime")] - public string? StartTime { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("completeTime")] + public string? CompleteTime { get; set; } /// - /// Output only. Metrics collected during tuning.
- /// Included only in responses + /// Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance ///
- [global::System.Text.Json.Serialization.JsonPropertyName("snapshots")] - public global::System.Collections.Generic.IList? Snapshots { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("hyperparameters")] + public global::Google.Gemini.Hyperparameters? Hyperparameters { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -50,16 +50,6 @@ public sealed partial class TuningTask /// /// Initializes a new instance of the class. /// - /// - /// Dataset for training or validation. - /// - /// - /// Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance - /// - /// - /// Output only. The timestamp when tuning this model completed.
- /// Included only in responses - /// /// /// Output only. The timestamp when tuning this model started.
/// Included only in responses @@ -68,21 +58,31 @@ public sealed partial class TuningTask /// Output only. Metrics collected during tuning.
/// Included only in responses /// + /// + /// Dataset for training or validation. + /// + /// + /// Output only. The timestamp when tuning this model completed.
+ /// Included only in responses + /// + /// + /// Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public TuningTask( + string? startTime, + global::System.Collections.Generic.IList? snapshots, global::Google.Gemini.Dataset? trainingData, - global::Google.Gemini.Hyperparameters? hyperparameters, string? completeTime, - string? startTime, - global::System.Collections.Generic.IList? snapshots) + global::Google.Gemini.Hyperparameters? hyperparameters) { - this.TrainingData = trainingData; - this.Hyperparameters = hyperparameters; - this.CompleteTime = completeTime; this.StartTime = startTime; this.Snapshots = snapshots; + this.TrainingData = trainingData; + this.CompleteTime = completeTime; + this.Hyperparameters = hyperparameters; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UploadToFileSearchStoreRequest.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UploadToFileSearchStoreRequest.g.cs index 0c2e40f06..fa4c84a73 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UploadToFileSearchStoreRequest.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UploadToFileSearchStoreRequest.g.cs @@ -8,12 +8,6 @@ namespace Google.Gemini /// public sealed partial class UploadToFileSearchStoreRequest { - /// - /// Custom metadata to be associated with the data. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("customMetadata")] - public global::System.Collections.Generic.IList? CustomMetadata { get; set; } - /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto /// @@ -26,6 +20,12 @@ public sealed partial class UploadToFileSearchStoreRequest [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] public string? DisplayName { get; set; } + /// + /// Custom metadata to be associated with the data. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("customMetadata")] + public global::System.Collections.Generic.IList? CustomMetadata { get; set; } + /// /// Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content. /// @@ -41,15 +41,15 @@ public sealed partial class UploadToFileSearchStoreRequest /// /// Initializes a new instance of the class. /// - /// - /// Custom metadata to be associated with the data. - /// /// /// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto /// /// /// Optional. Display name of the created document. /// + /// + /// Custom metadata to be associated with the data. + /// /// /// Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content. /// @@ -57,14 +57,14 @@ public sealed partial class UploadToFileSearchStoreRequest [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public UploadToFileSearchStoreRequest( - global::System.Collections.Generic.IList? customMetadata, global::Google.Gemini.ChunkingConfig? chunkingConfig, string? displayName, + global::System.Collections.Generic.IList? customMetadata, string? mimeType) { - this.CustomMetadata = customMetadata; this.ChunkingConfig = chunkingConfig; this.DisplayName = displayName; + this.CustomMetadata = customMetadata; this.MimeType = mimeType; } diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UsageMetadata.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UsageMetadata.g.cs index 90106d4ad..5ffe6a832 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UsageMetadata.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.UsageMetadata.g.cs @@ -9,18 +9,17 @@ namespace Google.Gemini public sealed partial class UsageMetadata { /// - /// Output only. Number of tokens present in tool-use prompt(s).
- /// Included only in responses + /// Number of tokens in the cached part of the prompt (the cached content) ///
- [global::System.Text.Json.Serialization.JsonPropertyName("toolUsePromptTokenCount")] - public int? ToolUsePromptTokenCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("cachedContentTokenCount")] + public int? CachedContentTokenCount { get; set; } /// - /// Output only. List of modalities that were returned in the response.
+ /// Output only. Number of tokens of thoughts for thinking models.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("candidatesTokensDetails")] - public global::System.Collections.Generic.IList? CandidatesTokensDetails { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("thoughtsTokenCount")] + public int? ThoughtsTokenCount { get; set; } /// /// Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. @@ -29,31 +28,25 @@ public sealed partial class UsageMetadata public int? PromptTokenCount { get; set; } /// - /// Output only. List of modalities that were processed in the request input.
+ /// Output only. List of modalities of the cached content in the request input.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("promptTokensDetails")] - public global::System.Collections.Generic.IList? PromptTokensDetails { get; set; } - - /// - /// Number of tokens in the cached part of the prompt (the cached content) - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cachedContentTokenCount")] - public int? CachedContentTokenCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("cacheTokensDetails")] + public global::System.Collections.Generic.IList? CacheTokensDetails { get; set; } /// - /// Output only. Number of tokens of thoughts for thinking models.
+ /// Output only. List of modalities that were processed for tool-use request inputs.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("thoughtsTokenCount")] - public int? ThoughtsTokenCount { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("toolUsePromptTokensDetails")] + public global::System.Collections.Generic.IList? ToolUsePromptTokensDetails { get; set; } /// - /// Output only. List of modalities of the cached content in the request input.
+ /// Output only. Number of tokens present in tool-use prompt(s).
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("cacheTokensDetails")] - public global::System.Collections.Generic.IList? CacheTokensDetails { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("toolUsePromptTokenCount")] + public int? ToolUsePromptTokenCount { get; set; } /// /// Total token count for the generation request (prompt + thoughts + response candidates). @@ -62,11 +55,18 @@ public sealed partial class UsageMetadata public int? TotalTokenCount { get; set; } /// - /// Output only. List of modalities that were processed for tool-use request inputs.
+ /// Output only. List of modalities that were processed in the request input.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("toolUsePromptTokensDetails")] - public global::System.Collections.Generic.IList? ToolUsePromptTokensDetails { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("promptTokensDetails")] + public global::System.Collections.Generic.IList? PromptTokensDetails { get; set; } + + /// + /// Output only. List of modalities that were returned in the response.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("candidatesTokensDetails")] + public global::System.Collections.Generic.IList? CandidatesTokensDetails { get; set; } /// /// Total number of tokens across all the generated response candidates. @@ -97,37 +97,37 @@ public sealed partial class UsageMetadata /// /// Initializes a new instance of the class. /// - /// - /// Output only. Number of tokens present in tool-use prompt(s).
- /// Included only in responses + /// + /// Number of tokens in the cached part of the prompt (the cached content) /// - /// - /// Output only. List of modalities that were returned in the response.
+ /// + /// Output only. Number of tokens of thoughts for thinking models.
/// Included only in responses /// /// /// Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. /// - /// - /// Output only. List of modalities that were processed in the request input.
+ /// + /// Output only. List of modalities of the cached content in the request input.
/// Included only in responses /// - /// - /// Number of tokens in the cached part of the prompt (the cached content) - /// - /// - /// Output only. Number of tokens of thoughts for thinking models.
+ /// + /// Output only. List of modalities that were processed for tool-use request inputs.
/// Included only in responses /// - /// - /// Output only. List of modalities of the cached content in the request input.
+ /// + /// Output only. Number of tokens present in tool-use prompt(s).
/// Included only in responses /// /// /// Total token count for the generation request (prompt + thoughts + response candidates). /// - /// - /// Output only. List of modalities that were processed for tool-use request inputs.
+ /// + /// Output only. List of modalities that were processed in the request input.
+ /// Included only in responses + /// + /// + /// Output only. List of modalities that were returned in the response.
/// Included only in responses /// /// @@ -145,28 +145,28 @@ public sealed partial class UsageMetadata [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public UsageMetadata( - int? toolUsePromptTokenCount, - global::System.Collections.Generic.IList? candidatesTokensDetails, - int? promptTokenCount, - global::System.Collections.Generic.IList? promptTokensDetails, int? cachedContentTokenCount, int? thoughtsTokenCount, + int? promptTokenCount, global::System.Collections.Generic.IList? cacheTokensDetails, - int? totalTokenCount, global::System.Collections.Generic.IList? toolUsePromptTokensDetails, + int? toolUsePromptTokenCount, + int? totalTokenCount, + global::System.Collections.Generic.IList? promptTokensDetails, + global::System.Collections.Generic.IList? candidatesTokensDetails, int? candidatesTokenCount, int? responseTokenCount, global::System.Collections.Generic.IList? responseTokensDetails) { - this.ToolUsePromptTokenCount = toolUsePromptTokenCount; - this.CandidatesTokensDetails = candidatesTokensDetails; - this.PromptTokenCount = promptTokenCount; - this.PromptTokensDetails = promptTokensDetails; this.CachedContentTokenCount = cachedContentTokenCount; this.ThoughtsTokenCount = thoughtsTokenCount; + this.PromptTokenCount = promptTokenCount; this.CacheTokensDetails = cacheTokensDetails; - this.TotalTokenCount = totalTokenCount; this.ToolUsePromptTokensDetails = toolUsePromptTokensDetails; + this.ToolUsePromptTokenCount = toolUsePromptTokenCount; + this.TotalTokenCount = totalTokenCount; + this.PromptTokensDetails = promptTokensDetails; + this.CandidatesTokensDetails = candidatesTokensDetails; this.CandidatesTokenCount = candidatesTokenCount; this.ResponseTokenCount = responseTokenCount; this.ResponseTokensDetails = responseTokensDetails; diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.VideoMetadata.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.VideoMetadata.g.cs index 0745a5655..3719af7e4 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.VideoMetadata.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.VideoMetadata.g.cs @@ -9,13 +9,6 @@ namespace Google.Gemini [global::System.Obsolete("This model marked as deprecated.")] public sealed partial class VideoMetadata { - /// - /// Optional. The end offset of the video. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("endOffset")] - [global::System.Obsolete("This property marked as deprecated.")] - public string? EndOffset { get; set; } - /// /// Optional. The start offset of the video. /// @@ -30,6 +23,13 @@ public sealed partial class VideoMetadata [global::System.Obsolete("This property marked as deprecated.")] public double? Fps { get; set; } + /// + /// Optional. The end offset of the video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endOffset")] + [global::System.Obsolete("This property marked as deprecated.")] + public string? EndOffset { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -39,26 +39,26 @@ public sealed partial class VideoMetadata /// /// Initializes a new instance of the class. /// - /// - /// Optional. The end offset of the video. - /// /// /// Optional. The start offset of the video. /// /// /// Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0]. /// + /// + /// Optional. The end offset of the video. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public VideoMetadata( - string? endOffset, string? startOffset, - double? fps) + double? fps, + string? endOffset) { - this.EndOffset = endOffset; this.StartOffset = startOffset; this.Fps = fps; + this.EndOffset = endOffset; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Web.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Web.g.cs index 76dde6794..31d654f12 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Web.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.Web.g.cs @@ -9,18 +9,18 @@ namespace Google.Gemini public sealed partial class Web { /// - /// Output only. URI reference of the chunk.
+ /// Output only. Title of the chunk.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("uri")] - public string? Uri { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("title")] + public string? Title { get; set; } /// - /// Output only. Title of the chunk.
+ /// Output only. URI reference of the chunk.
/// Included only in responses ///
- [global::System.Text.Json.Serialization.JsonPropertyName("title")] - public string? Title { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("uri")] + public string? Uri { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -31,23 +31,23 @@ public sealed partial class Web /// /// Initializes a new instance of the class. /// - /// - /// Output only. URI reference of the chunk.
- /// Included only in responses - /// /// /// Output only. Title of the chunk.
/// Included only in responses /// + /// + /// Output only. URI reference of the chunk.
+ /// Included only in responses + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Web( - string? uri, - string? title) + string? title, + string? uri) { - this.Uri = uri; this.Title = title; + this.Uri = uri; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.WhiteSpaceConfig.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.WhiteSpaceConfig.g.cs index df96fff2d..6775dc957 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.Models.WhiteSpaceConfig.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.Models.WhiteSpaceConfig.g.cs @@ -8,18 +8,18 @@ namespace Google.Gemini /// public sealed partial class WhiteSpaceConfig { - /// - /// Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maxTokensPerChunk")] - public int? MaxTokensPerChunk { get; set; } - /// /// Maximum number of overlapping tokens between two adjacent chunks. /// [global::System.Text.Json.Serialization.JsonPropertyName("maxOverlapTokens")] public int? MaxOverlapTokens { get; set; } + /// + /// Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxTokensPerChunk")] + public int? MaxTokensPerChunk { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -29,21 +29,21 @@ public sealed partial class WhiteSpaceConfig /// /// Initializes a new instance of the class. /// - /// - /// Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow. - /// /// /// Maximum number of overlapping tokens between two adjacent chunks. /// + /// + /// Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public WhiteSpaceConfig( - int? maxTokensPerChunk, - int? maxOverlapTokens) + int? maxOverlapTokens, + int? maxTokensPerChunk) { - this.MaxTokensPerChunk = maxTokensPerChunk; this.MaxOverlapTokens = maxOverlapTokens; + this.MaxTokensPerChunk = maxTokensPerChunk; } /// diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.OptionsSupport.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.OptionsSupport.g.cs index e423a8d77..9fde903da 100644 --- a/src/libs/Google.Gemini/Generated/Google.Gemini.OptionsSupport.g.cs +++ b/src/libs/Google.Gemini/Generated/Google.Gemini.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::Google.Gemini.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::Google.Gemini.AutoSDKClientOptions clientOptions, global::Google.Gemini.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Google.Gemini.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::Google.Gemini.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/Google.Gemini/openapi.json b/src/libs/Google.Gemini/openapi.json index c4da7b796..95d3d0844 100644 --- a/src/libs/Google.Gemini/openapi.json +++ b/src/libs/Google.Gemini/openapi.json @@ -11,82 +11,57 @@ } ], "paths": { - "/dynamic/{dynamicId}:generateContent": { - "post": { - "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", - "operationId": "dynamic.generateContent", + "/batches/{batchesId}": { + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "operationId": "batches.get", "parameters": [ { - "name": "dynamicId", + "name": "batchesId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "The name of the operation resource.", "schema": { "type": "string", - "pattern": "^dynamic/[^/]+$" + "pattern": "^batches/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" + "$ref": "#/components/schemas/Operation" } } } } } - } - }, - "/dynamic/{dynamicId}:streamGenerateContent": { - "post": { - "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", - "operationId": "dynamic.streamGenerateContent", + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "operationId": "batches.delete", "parameters": [ { - "name": "dynamicId", + "name": "batchesId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "The name of the operation resource to be deleted.", "schema": { "type": "string", - "pattern": "^dynamic/[^/]+$" + "pattern": "^batches/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" - } - }, - "text/event-stream": { - "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" + "$ref": "#/components/schemas/Empty" } } } @@ -142,95 +117,42 @@ } } }, - "/batches/{batchesId}:updateGenerateContentBatch": { - "patch": { - "description": "Updates a batch of GenerateContent requests for batch processing.", - "operationId": "batches.updateGenerateContentBatch", + "/batches": { + "get": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "operationId": "batches.list", "parameters": [ { - "name": "batchesId", - "in": "path", - "required": true, - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", + "name": "filter", + "in": "query", + "description": "The standard list filter.", "schema": { - "type": "string", - "pattern": "^batches/[^/]+$" + "type": "string" } }, { - "name": "updateMask", + "name": "pageSize", "in": "query", - "description": "Optional. The list of fields to update.", + "description": "The standard list page size.", "schema": { - "type": "string", - "format": "google-fieldmask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentBatch" - } - } - } - }, - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentBatch" - } - } + "type": "integer", + "format": "int32" } - } - } - } - }, - "/batches/{batchesId}": { - "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "operationId": "batches.get", - "parameters": [ + }, { - "name": "batchesId", - "in": "path", - "required": true, - "description": "The name of the operation resource.", + "name": "pageToken", + "in": "query", + "description": "The standard list page token.", "schema": { - "type": "string", - "pattern": "^batches/[^/]+$" - } - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Operation" - } - } + "type": "string" } - } - } - }, - "delete": { - "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", - "operationId": "batches.delete", - "parameters": [ + }, { - "name": "batchesId", - "in": "path", - "required": true, - "description": "The name of the operation resource to be deleted.", + "name": "returnPartialSuccess", + "in": "query", + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", "schema": { - "type": "string", - "pattern": "^batches/[^/]+$" + "type": "boolean" } } ], @@ -240,7 +162,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/ListOperationsResponse" } } } @@ -278,52 +200,47 @@ } } }, - "/batches": { - "get": { - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "operationId": "batches.list", + "/batches/{batchesId}:updateGenerateContentBatch": { + "patch": { + "description": "Updates a batch of GenerateContent requests for batch processing.", + "operationId": "batches.updateGenerateContentBatch", "parameters": [ { - "name": "filter", - "in": "query", - "description": "The standard list filter.", - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "The standard list page size.", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "pageToken", - "in": "query", - "description": "The standard list page token.", + "name": "batchesId", + "in": "path", + "required": true, + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", "schema": { - "type": "string" + "type": "string", + "pattern": "^batches/[^/]+$" } }, { - "name": "returnPartialSuccess", + "name": "updateMask", "in": "query", - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "description": "Optional. The list of fields to update.", "schema": { - "type": "boolean" + "type": "string", + "format": "google-fieldmask" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateContentBatch" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOperationsResponse" + "$ref": "#/components/schemas/GenerateContentBatch" } } } @@ -507,22 +424,19 @@ } } }, - "/corpora/{corporaId}": { - "get": { - "description": "Gets information about a specific `Corpus`.", - "operationId": "corpora.get", - "parameters": [ - { - "name": "corporaId", - "in": "path", - "required": true, - "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`", - "schema": { - "type": "string", - "pattern": "^corpora/[^/]+$" + "/corpora": { + "post": { + "description": "Creates an empty `Corpus`.", + "operationId": "corpora.create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Corpus" + } } } - ], + }, "responses": { "200": { "description": "Successful response", @@ -536,26 +450,25 @@ } } }, - "delete": { - "description": "Deletes a `Corpus`.", - "operationId": "corpora.delete", + "get": { + "description": "Lists all `Corpora` owned by the user.", + "operationId": "corpora.list", "parameters": [ { - "name": "force", + "name": "pageSize", "in": "query", - "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.", + "description": "Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.", "schema": { - "type": "boolean" + "type": "integer", + "format": "int32" } }, { - "name": "corporaId", - "in": "path", - "required": true, - "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", + "name": "pageToken", + "in": "query", + "description": "Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.", "schema": { - "type": "string", - "pattern": "^corpora/[^/]+$" + "type": "string" } } ], @@ -565,7 +478,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/ListCorporaResponse" } } } @@ -573,19 +486,22 @@ } } }, - "/corpora": { - "post": { - "description": "Creates an empty `Corpus`.", - "operationId": "corpora.create", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Corpus" - } + "/corpora/{corporaId}": { + "get": { + "description": "Gets information about a specific `Corpus`.", + "operationId": "corpora.get", + "parameters": [ + { + "name": "corporaId", + "in": "path", + "required": true, + "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`", + "schema": { + "type": "string", + "pattern": "^corpora/[^/]+$" } } - }, + ], "responses": { "200": { "description": "Successful response", @@ -599,25 +515,26 @@ } } }, - "get": { - "description": "Lists all `Corpora` owned by the user.", - "operationId": "corpora.list", + "delete": { + "description": "Deletes a `Corpus`.", + "operationId": "corpora.delete", "parameters": [ { - "name": "pageSize", + "name": "force", "in": "query", - "description": "Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.", + "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.", "schema": { - "type": "integer", - "format": "int32" + "type": "boolean" } }, { - "name": "pageToken", - "in": "query", - "description": "Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.", + "name": "corporaId", + "in": "path", + "required": true, + "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", "schema": { - "type": "string" + "type": "string", + "pattern": "^corpora/[^/]+$" } } ], @@ -627,7 +544,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListCorporaResponse" + "$ref": "#/components/schemas/Empty" } } } @@ -635,13 +552,13 @@ } } }, - "/corpora/{corporaId}/permissions/{permissionsId}": { + "/corpora/{corporaId}/operations/{operationsId}": { "get": { - "description": "Gets information about a specific Permission.", - "operationId": "corpora.permissions.get", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "operationId": "corpora.operations.get", "parameters": [ { - "name": "permissionsId", + "name": "operationsId", "in": "path", "required": true, "schema": { @@ -652,10 +569,10 @@ "name": "corporaId", "in": "path", "required": true, - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "description": "The name of the operation resource.", "schema": { "type": "string", - "pattern": "^corpora/[^/]+/permissions/[^/]+$" + "pattern": "^corpora/[^/]+/operations/[^/]+$" } } ], @@ -665,21 +582,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Permission" + "$ref": "#/components/schemas/Operation" } } } } } - }, - "delete": { - "description": "Deletes the permission.", - "operationId": "corpora.permissions.delete", + } + }, + "/corpora/{corporaId}/permissions": { + "get": { + "description": "Lists permissions for the specific resource.", + "operationId": "corpora.permissions.list", "parameters": [ { - "name": "permissionsId", - "in": "path", - "required": true, + "name": "pageSize", + "in": "query", + "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageToken", + "in": "query", + "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", "schema": { "type": "string" } @@ -688,10 +616,10 @@ "name": "corporaId", "in": "path", "required": true, - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "schema": { "type": "string", - "pattern": "^corpora/[^/]+/permissions/[^/]+$" + "pattern": "^corpora/[^/]+$" } } ], @@ -701,42 +629,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/ListPermissionsResponse" } } } } } }, - "patch": { - "description": "Updates the permission.", - "operationId": "corpora.permissions.patch", + "post": { + "description": "Create a permission to a specific resource.", + "operationId": "corpora.permissions.create", "parameters": [ - { - "name": "permissionsId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "corporaId", "in": "path", "required": true, - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", - "schema": { - "type": "string", - "pattern": "^corpora/[^/]+/permissions/[^/]+$" - } - }, - { - "name": "updateMask", - "in": "query", - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", + "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "schema": { "type": "string", - "format": "google-fieldmask" + "pattern": "^corpora/[^/]+$" } } ], @@ -763,31 +674,30 @@ } } }, - "/corpora/{corporaId}/permissions": { - "post": { - "description": "Create a permission to a specific resource.", - "operationId": "corpora.permissions.create", + "/corpora/{corporaId}/permissions/{permissionsId}": { + "get": { + "description": "Gets information about a specific Permission.", + "operationId": "corpora.permissions.get", "parameters": [ + { + "name": "permissionsId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "corporaId", "in": "path", "required": true, - "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "schema": { "type": "string", - "pattern": "^corpora/[^/]+$" + "pattern": "^corpora/[^/]+/permissions/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Permission" - } - } - } - }, "responses": { "200": { "description": "Successful response", @@ -801,23 +711,14 @@ } } }, - "get": { - "description": "Lists permissions for the specific resource.", - "operationId": "corpora.permissions.list", + "patch": { + "description": "Updates the permission.", + "operationId": "corpora.permissions.patch", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "pageToken", - "in": "query", - "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", + "name": "permissionsId", + "in": "path", + "required": true, "schema": { "type": "string" } @@ -826,34 +727,50 @@ "name": "corporaId", "in": "path", "required": true, - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", "schema": { "type": "string", - "pattern": "^corpora/[^/]+$" + "pattern": "^corpora/[^/]+/permissions/[^/]+$" + } + }, + { + "name": "updateMask", + "in": "query", + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", + "schema": { + "type": "string", + "format": "google-fieldmask" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Permission" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPermissionsResponse" + "$ref": "#/components/schemas/Permission" } } } } } - } - }, - "/corpora/{corporaId}/operations/{operationsId}": { - "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "operationId": "corpora.operations.get", + }, + "delete": { + "description": "Deletes the permission.", + "operationId": "corpora.permissions.delete", "parameters": [ { - "name": "operationsId", + "name": "permissionsId", "in": "path", "required": true, "schema": { @@ -864,10 +781,10 @@ "name": "corporaId", "in": "path", "required": true, - "description": "The name of the operation resource.", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "schema": { "type": "string", - "pattern": "^corpora/[^/]+/operations/[^/]+$" + "pattern": "^corpora/[^/]+/permissions/[^/]+$" } } ], @@ -877,7 +794,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/Empty" } } } @@ -885,81 +802,65 @@ } } }, - "/cachedContents": { - "get": { - "description": "Lists CachedContents.", - "operationId": "cachedContents.list", + "/tunedModels/{tunedModelsId}": { + "patch": { + "description": "Updates a tuned model.", + "operationId": "tunedModels.patch", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "name": "tunedModelsId", + "in": "path", + "required": true, + "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "pattern": "^tunedModels/[^/]+$" } }, { - "name": "pageToken", + "name": "updateMask", "in": "query", - "description": "Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.", + "description": "Optional. The list of fields to update.", "schema": { - "type": "string" + "type": "string", + "format": "google-fieldmask" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunedModel" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListCachedContentsResponse" + "$ref": "#/components/schemas/TunedModel" } } } } } }, - "post": { - "description": "Creates CachedContent resource.", - "operationId": "cachedContents.create", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CachedContent" - } - } - } - }, - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CachedContent" - } - } - } - } - } - } - }, - "/cachedContents/{cachedContentsId}": { "get": { - "description": "Reads CachedContent resource.", - "operationId": "cachedContents.get", + "description": "Gets information about a specific TunedModel.", + "operationId": "tunedModels.get", "parameters": [ { - "name": "cachedContentsId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`", + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", "schema": { "type": "string", - "pattern": "^cachedContents/[^/]+$" + "pattern": "^tunedModels/[^/]+$" } } ], @@ -969,7 +870,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CachedContent" + "$ref": "#/components/schemas/TunedModel" } } } @@ -977,17 +878,17 @@ } }, "delete": { - "description": "Deletes CachedContent resource.", - "operationId": "cachedContents.delete", + "description": "Deletes a tuned model.", + "operationId": "tunedModels.delete", "parameters": [ { - "name": "cachedContentsId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`", + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", "schema": { "type": "string", - "pattern": "^cachedContents/[^/]+$" + "pattern": "^tunedModels/[^/]+$" } } ], @@ -1003,28 +904,21 @@ } } } - }, - "patch": { - "description": "Updates CachedContent resource (only expiration is updatable).", - "operationId": "cachedContents.patch", + } + }, + "/tunedModels/{tunedModelsId}:batchGenerateContent": { + "post": { + "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", + "operationId": "tunedModels.batchGenerateContent", "parameters": [ { - "name": "cachedContentsId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", - "schema": { - "type": "string", - "pattern": "^cachedContents/[^/]+$" - } - }, - { - "name": "updateMask", - "in": "query", - "description": "The list of fields to update.", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "schema": { "type": "string", - "format": "google-fieldmask" + "pattern": "^tunedModels/[^/]+$" } } ], @@ -1032,7 +926,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CachedContent" + "$ref": "#/components/schemas/BatchGenerateContentRequest" } } } @@ -1043,7 +937,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CachedContent" + "$ref": "#/components/schemas/Operation" } } } @@ -1051,57 +945,82 @@ } } }, - "/files/{filesId}": { - "get": { - "description": "Gets the metadata for the given `File`.", - "operationId": "files.get", + "/tunedModels/{tunedModelsId}:streamGenerateContent": { + "post": { + "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", + "operationId": "tunedModels.streamGenerateContent", "parameters": [ { - "name": "filesId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Required. The name of the `File` to get. Example: `files/abc-123`", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "schema": { "type": "string", - "pattern": "^files/[^/]+$" + "pattern": "^tunedModels/[^/]+$" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateContentRequest" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/File" + "$ref": "#/components/schemas/GenerateContentResponse" + } + }, + "text/event-stream": { + "schema": { + "$ref": "#/components/schemas/GenerateContentResponse" } } } } } - }, - "delete": { - "description": "Deletes the `File`.", - "operationId": "files.delete", + } + }, + "/tunedModels/{tunedModelsId}:transferOwnership": { + "post": { + "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.", + "operationId": "tunedModels.transferOwnership", "parameters": [ { - "name": "filesId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", + "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", "schema": { "type": "string", - "pattern": "^files/[^/]+$" + "pattern": "^tunedModels/[^/]+$" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferOwnershipRequest" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/TransferOwnershipResponse" } } } @@ -1109,15 +1028,27 @@ } } }, - "/files:register": { + "/tunedModels/{tunedModelsId}:generateContent": { "post": { - "description": "Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails.", - "operationId": "files.register", + "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", + "operationId": "tunedModels.generateContent", + "parameters": [ + { + "name": "tunedModelsId", + "in": "path", + "required": true, + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "schema": { + "type": "string", + "pattern": "^tunedModels/[^/]+$" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RegisterFilesRequest" + "$ref": "#/components/schemas/GenerateContentRequest" } } } @@ -1128,7 +1059,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RegisterFilesResponse" + "$ref": "#/components/schemas/GenerateContentResponse" } } } @@ -1136,55 +1067,73 @@ } } }, - "/fileSearchStores/{fileSearchStoresId}": { - "get": { - "description": "Gets information about a specific `FileSearchStore`.", - "operationId": "fileSearchStores.get", + "/tunedModels/{tunedModelsId}:asyncBatchEmbedContent": { + "post": { + "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", + "operationId": "tunedModels.asyncBatchEmbedContent", "parameters": [ { - "name": "fileSearchStoresId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Required. The name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "schema": { "type": "string", - "pattern": "^fileSearchStores/[^/]+$" + "pattern": "^tunedModels/[^/]+$" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncBatchEmbedContentRequest" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileSearchStore" + "$ref": "#/components/schemas/Operation" } } } } } - }, - "delete": { - "description": "Deletes a `FileSearchStore`.", - "operationId": "fileSearchStores.delete", + } + }, + "/tunedModels": { + "get": { + "description": "Lists created tuned models.", + "operationId": "tunedModels.list", "parameters": [ { - "name": "force", + "name": "filter", "in": "query", - "description": "Optional. If set to true, any `Document`s and objects related to this `FileSearchStore` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `FileSearchStore` contains any `Document`s.", + "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone", "schema": { - "type": "boolean" + "type": "string" } }, { - "name": "fileSearchStoresId", - "in": "path", - "required": true, - "description": "Required. The resource name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", + "name": "pageSize", + "in": "query", + "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.", "schema": { - "type": "string", - "pattern": "^fileSearchStores/[^/]+$" + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageToken", + "in": "query", + "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.", + "schema": { + "type": "string" } } ], @@ -1194,27 +1143,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/ListTunedModelsResponse" } } } } } - } - }, - "/fileSearchStores/{fileSearchStoresId}:importFile": { + }, "post": { - "description": "Imports a `File` from File Service to a `FileSearchStore`.", - "operationId": "fileSearchStores.importFile", + "description": "Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", + "operationId": "tunedModels.create", "parameters": [ { - "name": "fileSearchStoresId", - "in": "path", - "required": true, - "description": "Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123`", + "name": "tunedModelId", + "in": "query", + "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.", "schema": { - "type": "string", - "pattern": "^fileSearchStores/[^/]+$" + "type": "string" } } ], @@ -1222,7 +1167,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImportFileRequest" + "$ref": "#/components/schemas/TunedModel" } } } @@ -1241,75 +1186,67 @@ } } }, - "/fileSearchStores": { - "post": { - "description": "Creates an empty `FileSearchStore`.", - "operationId": "fileSearchStores.create", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileSearchStore" - } - } - } - }, - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileSearchStore" - } - } - } - } - } - }, - "get": { - "description": "Lists all `FileSearchStores` owned by the user.", - "operationId": "fileSearchStores.list", + "/tunedModels/{tunedModelsId}/permissions/{permissionsId}": { + "patch": { + "description": "Updates the permission.", + "operationId": "tunedModels.permissions.patch", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Optional. The maximum number of `FileSearchStores` to return (per page). The service may return fewer `FileSearchStores`. If unspecified, at most 10 `FileSearchStores` will be returned. The maximum size limit is 20 `FileSearchStores` per page.", + "name": "tunedModelsId", + "in": "path", + "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } }, { - "name": "pageToken", + "name": "permissionsId", + "in": "path", + "required": true, + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "schema": { + "type": "string", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" + } + }, + { + "name": "updateMask", "in": "query", - "description": "Optional. A page token, received from a previous `ListFileSearchStores` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListFileSearchStores` must match the call that provided the page token.", + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", "schema": { - "type": "string" + "type": "string", + "format": "google-fieldmask" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Permission" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListFileSearchStoresResponse" + "$ref": "#/components/schemas/Permission" } } } } } - } - }, - "/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}": { - "get": { - "description": "Gets information about a specific `Document`.", - "operationId": "fileSearchStores.documents.get", + }, + "delete": { + "description": "Deletes the permission.", + "operationId": "tunedModels.permissions.delete", "parameters": [ { - "name": "fileSearchStoresId", + "name": "tunedModelsId", "in": "path", "required": true, "schema": { @@ -1317,13 +1254,13 @@ } }, { - "name": "documentsId", + "name": "permissionsId", "in": "path", "required": true, - "description": "Required. The name of the `Document` to retrieve. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "schema": { "type": "string", - "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$" + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" } } ], @@ -1333,19 +1270,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Document" + "$ref": "#/components/schemas/Empty" } } } } } }, - "delete": { - "description": "Deletes a `Document`.", - "operationId": "fileSearchStores.documents.delete", + "get": { + "description": "Gets information about a specific Permission.", + "operationId": "tunedModels.permissions.get", "parameters": [ { - "name": "fileSearchStoresId", + "name": "tunedModelsId", "in": "path", "required": true, "schema": { @@ -1353,21 +1290,13 @@ } }, { - "name": "force", - "in": "query", - "description": "Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.", - "schema": { - "type": "boolean" - } - }, - { - "name": "documentsId", + "name": "permissionsId", "in": "path", "required": true, - "description": "Required. The resource name of the `Document` to delete. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", "schema": { "type": "string", - "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$" + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" } } ], @@ -1377,7 +1306,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/Permission" } } } @@ -1385,15 +1314,15 @@ } } }, - "/fileSearchStores/{fileSearchStoresId}/documents": { + "/tunedModels/{tunedModelsId}/permissions": { "get": { - "description": "Lists all `Document`s in a `Corpus`.", - "operationId": "fileSearchStores.documents.list", + "description": "Lists permissions for the specific resource.", + "operationId": "tunedModels.permissions.list", "parameters": [ { "name": "pageSize", "in": "query", - "description": "Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.", + "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.", "schema": { "type": "integer", "format": "int32" @@ -1402,19 +1331,19 @@ { "name": "pageToken", "in": "query", - "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.", + "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", "schema": { "type": "string" } }, { - "name": "fileSearchStoresId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Required. The name of the `FileSearchStore` containing `Document`s. Example: `fileSearchStores/my-file-search-store-123`", + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "schema": { "type": "string", - "pattern": "^fileSearchStores/[^/]+$" + "pattern": "^tunedModels/[^/]+$" } } ], @@ -1424,45 +1353,44 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListDocumentsResponse" + "$ref": "#/components/schemas/ListPermissionsResponse" } } } } } - } - }, - "/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}": { - "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "operationId": "fileSearchStores.operations.get", + }, + "post": { + "description": "Create a permission to a specific resource.", + "operationId": "tunedModels.permissions.create", "parameters": [ { - "name": "operationsId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "fileSearchStoresId", + "name": "tunedModelsId", "in": "path", "required": true, - "description": "The name of the operation resource.", + "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", "schema": { "type": "string", - "pattern": "^fileSearchStores/[^/]+/operations/[^/]+$" + "pattern": "^tunedModels/[^/]+$" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Permission" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/Permission" } } } @@ -1470,13 +1398,13 @@ } } }, - "/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}": { + "/tunedModels/{tunedModelsId}/operations/{operationsId}": { "get": { "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "operationId": "fileSearchStores.upload.operations.get", + "operationId": "tunedModels.operations.get", "parameters": [ { - "name": "operationsId", + "name": "tunedModelsId", "in": "path", "required": true, "schema": { @@ -1484,13 +1412,13 @@ } }, { - "name": "fileSearchStoresId", + "name": "operationsId", "in": "path", "required": true, "description": "The name of the operation resource.", "schema": { "type": "string", - "pattern": "^fileSearchStores/[^/]+/upload/operations/[^/]+$" + "pattern": "^tunedModels/[^/]+/operations/[^/]+$" } } ], @@ -1508,59 +1436,33 @@ } } }, - "/models/{modelsId}:streamGenerateContent": { - "post": { - "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", - "operationId": "models.streamGenerateContent", + "/tunedModels/{tunedModelsId}/operations": { + "get": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "operationId": "tunedModels.operations.list", "parameters": [ { - "name": "modelsId", + "name": "filter", + "in": "query", + "description": "The standard list filter.", + "schema": { + "type": "string" + } + }, + { + "name": "tunedModelsId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "The name of the operation's parent resource.", "schema": { "type": "string", - "pattern": "^models/[^/]+$" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" - } - }, - "text/event-stream": { - "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" - } - } + "pattern": "^tunedModels/[^/]+$" } - } - } - } - }, - "/models": { - "get": { - "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", - "operationId": "models.list", - "parameters": [ + }, { "name": "pageSize", "in": "query", - "description": "The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.", + "description": "The standard list page size.", "schema": { "type": "integer", "format": "int32" @@ -1569,10 +1471,18 @@ { "name": "pageToken", "in": "query", - "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.", + "description": "The standard list page token.", "schema": { "type": "string" } + }, + { + "name": "returnPartialSuccess", + "in": "query", + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "schema": { + "type": "boolean" + } } ], "responses": { @@ -1581,7 +1491,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListModelsResponse" + "$ref": "#/components/schemas/ListOperationsResponse" } } } @@ -1589,58 +1499,56 @@ } } }, - "/models/{modelsId}:asyncBatchEmbedContent": { - "post": { - "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", - "operationId": "models.asyncBatchEmbedContent", + "/cachedContents/{cachedContentsId}": { + "delete": { + "description": "Deletes CachedContent resource.", + "operationId": "cachedContents.delete", "parameters": [ { - "name": "modelsId", + "name": "cachedContentsId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`", "schema": { "type": "string", - "pattern": "^models/[^/]+$" + "pattern": "^cachedContents/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AsyncBatchEmbedContentRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/Empty" } } } } } - } - }, - "/models/{modelsId}:embedContent": { - "post": { - "description": "Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).", - "operationId": "models.embedContent", + }, + "patch": { + "description": "Updates CachedContent resource (only expiration is updatable).", + "operationId": "cachedContents.patch", "parameters": [ { - "name": "modelsId", + "name": "cachedContentsId", "in": "path", "required": true, - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", "schema": { "type": "string", - "pattern": "^models/[^/]+$" + "pattern": "^cachedContents/[^/]+$" + } + }, + { + "name": "updateMask", + "in": "query", + "description": "The list of fields to update.", + "schema": { + "type": "string", + "format": "google-fieldmask" } } ], @@ -1648,7 +1556,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmbedContentRequest" + "$ref": "#/components/schemas/CachedContent" } } } @@ -1659,46 +1567,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmbedContentResponse" + "$ref": "#/components/schemas/CachedContent" } } } } } - } - }, - "/models/{modelsId}:generateContent": { - "post": { - "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", - "operationId": "models.generateContent", + }, + "get": { + "description": "Reads CachedContent resource.", + "operationId": "cachedContents.get", "parameters": [ { - "name": "modelsId", + "name": "cachedContentsId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`", "schema": { "type": "string", - "pattern": "^models/[^/]+$" + "pattern": "^cachedContents/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" + "$ref": "#/components/schemas/CachedContent" } } } @@ -1706,27 +1603,15 @@ } } }, - "/models/{modelsId}:countTokens": { + "/cachedContents": { "post": { - "description": "Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.", - "operationId": "models.countTokens", - "parameters": [ - { - "name": "modelsId", - "in": "path", - "required": true, - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "schema": { - "type": "string", - "pattern": "^models/[^/]+$" - } - } - ], + "description": "Creates CachedContent resource.", + "operationId": "cachedContents.create", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CountTokensRequest" + "$ref": "#/components/schemas/CachedContent" } } } @@ -1737,27 +1622,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CountTokensResponse" + "$ref": "#/components/schemas/CachedContent" } } } } } - } - }, - "/models/{modelsId}": { + }, "get": { - "description": "Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", - "operationId": "models.get", + "description": "Lists CachedContents.", + "operationId": "cachedContents.list", "parameters": [ { - "name": "modelsId", - "in": "path", - "required": true, - "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "name": "pageSize", + "in": "query", + "description": "Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", "schema": { - "type": "string", - "pattern": "^models/[^/]+$" + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageToken", + "in": "query", + "description": "Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.", + "schema": { + "type": "string" } } ], @@ -1767,7 +1657,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Model" + "$ref": "#/components/schemas/ListCachedContentsResponse" } } } @@ -1775,27 +1665,15 @@ } } }, - "/models/{modelsId}:batchGenerateContent": { + "/files:register": { "post": { - "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", - "operationId": "models.batchGenerateContent", - "parameters": [ - { - "name": "modelsId", - "in": "path", - "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "schema": { - "type": "string", - "pattern": "^models/[^/]+$" - } - } - ], + "description": "Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails.", + "operationId": "files.register", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BatchGenerateContentRequest" + "$ref": "#/components/schemas/RegisterFilesRequest" } } } @@ -1806,7 +1684,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/RegisterFilesResponse" } } } @@ -1814,91 +1692,47 @@ } } }, - "/models/{modelsId}:batchEmbedContents": { - "post": { - "description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", - "operationId": "models.batchEmbedContents", + "/files/{filesId}": { + "get": { + "description": "Gets the metadata for the given `File`.", + "operationId": "files.get", "parameters": [ { - "name": "modelsId", + "name": "filesId", "in": "path", "required": true, - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "description": "Required. The name of the `File` to get. Example: `files/abc-123`", "schema": { "type": "string", - "pattern": "^models/[^/]+$" + "pattern": "^files/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BatchEmbedContentsRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BatchEmbedContentsResponse" + "$ref": "#/components/schemas/File" } } } } } - } - }, - "/models/{modelsId}/operations": { - "get": { - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "operationId": "models.operations.list", + }, + "delete": { + "description": "Deletes the `File`.", + "operationId": "files.delete", "parameters": [ { - "name": "filter", - "in": "query", - "description": "The standard list filter.", - "schema": { - "type": "string" - } - }, - { - "name": "modelsId", + "name": "filesId", "in": "path", "required": true, - "description": "The name of the operation's parent resource.", + "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", "schema": { "type": "string", - "pattern": "^models/[^/]+$" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "The standard list page size.", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "pageToken", - "in": "query", - "description": "The standard list page token.", - "schema": { - "type": "string" - } - }, - { - "name": "returnPartialSuccess", - "in": "query", - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", - "schema": { - "type": "boolean" + "pattern": "^files/[^/]+$" } } ], @@ -1908,7 +1742,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOperationsResponse" + "$ref": "#/components/schemas/Empty" } } } @@ -1916,37 +1750,38 @@ } } }, - "/models/{modelsId}/operations/{operationsId}": { - "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "operationId": "models.operations.get", + "/dynamic/{dynamicId}:generateContent": { + "post": { + "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", + "operationId": "dynamic.generateContent", "parameters": [ { - "name": "operationsId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "modelsId", + "name": "dynamicId", "in": "path", "required": true, - "description": "The name of the operation resource.", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "schema": { "type": "string", - "pattern": "^models/[^/]+/operations/[^/]+$" + "pattern": "^dynamic/[^/]+$" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateContentRequest" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/GenerateContentResponse" } } } @@ -1954,19 +1789,19 @@ } } }, - "/tunedModels/{tunedModelsId}:generateContent": { + "/dynamic/{dynamicId}:streamGenerateContent": { "post": { - "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", - "operationId": "tunedModels.generateContent", + "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", + "operationId": "dynamic.streamGenerateContent", "parameters": [ { - "name": "tunedModelsId", + "name": "dynamicId", "in": "path", "required": true, "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^dynamic/[^/]+$" } } ], @@ -1987,34 +1822,30 @@ "schema": { "$ref": "#/components/schemas/GenerateContentResponse" } + }, + "text/event-stream": { + "schema": { + "$ref": "#/components/schemas/GenerateContentResponse" + } } } } } } }, - "/tunedModels/{tunedModelsId}": { - "patch": { - "description": "Updates a tuned model.", - "operationId": "tunedModels.patch", + "/fileSearchStores/{fileSearchStoresId}:importFile": { + "post": { + "description": "Imports a `File` from File Service to a `FileSearchStore`.", + "operationId": "fileSearchStores.importFile", "parameters": [ { - "name": "tunedModelsId", + "name": "fileSearchStoresId", "in": "path", "required": true, - "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", - "schema": { - "type": "string", - "pattern": "^tunedModels/[^/]+$" - } - }, - { - "name": "updateMask", - "in": "query", - "description": "Optional. The list of fields to update.", + "description": "Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123`", "schema": { "type": "string", - "format": "google-fieldmask" + "pattern": "^fileSearchStores/[^/]+$" } } ], @@ -2022,7 +1853,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TunedModel" + "$ref": "#/components/schemas/ImportFileRequest" } } } @@ -2033,25 +1864,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TunedModel" + "$ref": "#/components/schemas/Operation" } } } } } - }, - "get": { - "description": "Gets information about a specific TunedModel.", - "operationId": "tunedModels.get", + } + }, + "/fileSearchStores/{fileSearchStoresId}": { + "delete": { + "description": "Deletes a `FileSearchStore`.", + "operationId": "fileSearchStores.delete", "parameters": [ { - "name": "tunedModelsId", + "name": "force", + "in": "query", + "description": "Optional. If set to true, any `Document`s and objects related to this `FileSearchStore` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `FileSearchStore` contains any `Document`s.", + "schema": { + "type": "boolean" + } + }, + { + "name": "fileSearchStoresId", "in": "path", "required": true, - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", + "description": "Required. The resource name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^fileSearchStores/[^/]+$" } } ], @@ -2061,25 +1902,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TunedModel" + "$ref": "#/components/schemas/Empty" } } } } } }, - "delete": { - "description": "Deletes a tuned model.", - "operationId": "tunedModels.delete", + "get": { + "description": "Gets information about a specific `FileSearchStore`.", + "operationId": "fileSearchStores.get", "parameters": [ { - "name": "tunedModelsId", + "name": "fileSearchStoresId", "in": "path", "required": true, - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", + "description": "Required. The name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^fileSearchStores/[^/]+$" } } ], @@ -2089,7 +1930,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/FileSearchStore" } } } @@ -2097,25 +1938,15 @@ } } }, - "/tunedModels": { + "/fileSearchStores": { "post": { - "description": "Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", - "operationId": "tunedModels.create", - "parameters": [ - { - "name": "tunedModelId", - "in": "query", - "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.", - "schema": { - "type": "string" - } - } - ], + "description": "Creates an empty `FileSearchStore`.", + "operationId": "fileSearchStores.create", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TunedModel" + "$ref": "#/components/schemas/FileSearchStore" } } } @@ -2126,7 +1957,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/FileSearchStore" } } } @@ -2134,21 +1965,13 @@ } }, "get": { - "description": "Lists created tuned models.", - "operationId": "tunedModels.list", + "description": "Lists all `FileSearchStores` owned by the user.", + "operationId": "fileSearchStores.list", "parameters": [ - { - "name": "filter", - "in": "query", - "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone", - "schema": { - "type": "string" - } - }, { "name": "pageSize", "in": "query", - "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.", + "description": "Optional. The maximum number of `FileSearchStores` to return (per page). The service may return fewer `FileSearchStores`. If unspecified, at most 10 `FileSearchStores` will be returned. The maximum size limit is 20 `FileSearchStores` per page.", "schema": { "type": "integer", "format": "int32" @@ -2157,7 +1980,7 @@ { "name": "pageToken", "in": "query", - "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.", + "description": "Optional. A page token, received from a previous `ListFileSearchStores` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListFileSearchStores` must match the call that provided the page token.", "schema": { "type": "string" } @@ -2169,7 +1992,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListTunedModelsResponse" + "$ref": "#/components/schemas/ListFileSearchStoresResponse" } } } @@ -2177,43 +2000,37 @@ } } }, - "/tunedModels/{tunedModelsId}:streamGenerateContent": { - "post": { - "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", - "operationId": "tunedModels.streamGenerateContent", + "/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}": { + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "operationId": "fileSearchStores.upload.operations.get", "parameters": [ { - "name": "tunedModelsId", + "name": "operationsId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "schema": { + "type": "string" + } + }, + { + "name": "fileSearchStoresId", + "in": "path", + "required": true, + "description": "The name of the operation resource.", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^fileSearchStores/[^/]+/upload/operations/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateContentRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" - } - }, - "text/event-stream": { - "schema": { - "$ref": "#/components/schemas/GenerateContentResponse" + "$ref": "#/components/schemas/Operation" } } } @@ -2221,77 +2038,81 @@ } } }, - "/tunedModels/{tunedModelsId}:transferOwnership": { - "post": { - "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.", - "operationId": "tunedModels.transferOwnership", + "/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}": { + "get": { + "description": "Gets information about a specific `Document`.", + "operationId": "fileSearchStores.documents.get", "parameters": [ { - "name": "tunedModelsId", + "name": "fileSearchStoresId", "in": "path", "required": true, - "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", + "schema": { + "type": "string" + } + }, + { + "name": "documentsId", + "in": "path", + "required": true, + "description": "Required. The name of the `Document` to retrieve. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransferOwnershipRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TransferOwnershipResponse" + "$ref": "#/components/schemas/Document" } } } } } - } - }, - "/tunedModels/{tunedModelsId}:asyncBatchEmbedContent": { - "post": { - "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", - "operationId": "tunedModels.asyncBatchEmbedContent", + }, + "delete": { + "description": "Deletes a `Document`.", + "operationId": "fileSearchStores.documents.delete", "parameters": [ { - "name": "tunedModelsId", + "name": "fileSearchStoresId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.", + "schema": { + "type": "boolean" + } + }, + { + "name": "documentsId", + "in": "path", + "required": true, + "description": "Required. The resource name of the `Document` to delete. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AsyncBatchEmbedContentRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/Empty" } } } @@ -2299,38 +2120,46 @@ } } }, - "/tunedModels/{tunedModelsId}:batchGenerateContent": { - "post": { - "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", - "operationId": "tunedModels.batchGenerateContent", + "/fileSearchStores/{fileSearchStoresId}/documents": { + "get": { + "description": "Lists all `Document`s in a `Corpus`.", + "operationId": "fileSearchStores.documents.list", "parameters": [ { - "name": "tunedModelsId", + "name": "pageSize", + "in": "query", + "description": "Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageToken", + "in": "query", + "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.", + "schema": { + "type": "string" + } + }, + { + "name": "fileSearchStoresId", "in": "path", "required": true, - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "description": "Required. The name of the `FileSearchStore` containing `Document`s. Example: `fileSearchStores/my-file-search-store-123`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^fileSearchStores/[^/]+$" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BatchGenerateContentRequest" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/ListDocumentsResponse" } } } @@ -2338,13 +2167,13 @@ } } }, - "/tunedModels/{tunedModelsId}/operations/{operationsId}": { + "/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}": { "get": { "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "operationId": "tunedModels.operations.get", + "operationId": "fileSearchStores.operations.get", "parameters": [ { - "name": "tunedModelsId", + "name": "operationsId", "in": "path", "required": true, "schema": { @@ -2352,13 +2181,13 @@ } }, { - "name": "operationsId", + "name": "fileSearchStoresId", "in": "path", "required": true, "description": "The name of the operation resource.", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+/operations/[^/]+$" + "pattern": "^fileSearchStores/[^/]+/operations/[^/]+$" } } ], @@ -2376,62 +2205,38 @@ } } }, - "/tunedModels/{tunedModelsId}/operations": { - "get": { - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "operationId": "tunedModels.operations.list", + "/models/{modelsId}:generateContent": { + "post": { + "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", + "operationId": "models.generateContent", "parameters": [ { - "name": "filter", - "in": "query", - "description": "The standard list filter.", - "schema": { - "type": "string" - } - }, - { - "name": "tunedModelsId", + "name": "modelsId", "in": "path", "required": true, - "description": "The name of the operation's parent resource.", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "The standard list page size.", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "pageToken", - "in": "query", - "description": "The standard list page token.", - "schema": { - "type": "string" - } - }, - { - "name": "returnPartialSuccess", - "in": "query", - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", - "schema": { - "type": "boolean" + "pattern": "^models/[^/]+$" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateContentRequest" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOperationsResponse" + "$ref": "#/components/schemas/GenerateContentResponse" } } } @@ -2439,108 +2244,58 @@ } } }, - "/tunedModels/{tunedModelsId}/permissions/{permissionsId}": { - "get": { - "description": "Gets information about a specific Permission.", - "operationId": "tunedModels.permissions.get", + "/models/{modelsId}:batchEmbedContents": { + "post": { + "description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", + "operationId": "models.batchEmbedContents", "parameters": [ { - "name": "tunedModelsId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "permissionsId", + "name": "modelsId", "in": "path", "required": true, - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" + "pattern": "^models/[^/]+$" } } ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Permission" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchEmbedContentsRequest" } } } - } - }, - "delete": { - "description": "Deletes the permission.", - "operationId": "tunedModels.permissions.delete", - "parameters": [ - { - "name": "tunedModelsId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "permissionsId", - "in": "path", - "required": true, - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "schema": { - "type": "string", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" - } - } - ], + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/BatchEmbedContentsResponse" } } } } } - }, - "patch": { - "description": "Updates the permission.", - "operationId": "tunedModels.permissions.patch", + } + }, + "/models/{modelsId}:streamGenerateContent": { + "post": { + "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", + "operationId": "models.streamGenerateContent", "parameters": [ { - "name": "tunedModelsId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "permissionsId", + "name": "modelsId", "in": "path", "required": true, - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", - "schema": { - "type": "string", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" - } - }, - { - "name": "updateMask", - "in": "query", - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", "schema": { "type": "string", - "format": "google-fieldmask" + "pattern": "^models/[^/]+$" } } ], @@ -2548,7 +2303,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Permission" + "$ref": "#/components/schemas/GenerateContentRequest" } } } @@ -2559,7 +2314,12 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Permission" + "$ref": "#/components/schemas/GenerateContentResponse" + } + }, + "text/event-stream": { + "schema": { + "$ref": "#/components/schemas/GenerateContentResponse" } } } @@ -2567,19 +2327,19 @@ } } }, - "/tunedModels/{tunedModelsId}/permissions": { + "/models/{modelsId}:embedContent": { "post": { - "description": "Create a permission to a specific resource.", - "operationId": "tunedModels.permissions.create", + "description": "Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).", + "operationId": "models.embedContent", "parameters": [ { - "name": "tunedModelsId", + "name": "modelsId", "in": "path", "required": true, - "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^models/[^/]+$" } } ], @@ -2587,7 +2347,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Permission" + "$ref": "#/components/schemas/EmbedContentRequest" } } } @@ -2598,21 +2358,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Permission" + "$ref": "#/components/schemas/EmbedContentResponse" } } } } } - }, + } + }, + "/models": { "get": { - "description": "Lists permissions for the specific resource.", - "operationId": "tunedModels.permissions.list", + "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", + "operationId": "models.list", "parameters": [ { "name": "pageSize", "in": "query", - "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.", + "description": "The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.", "schema": { "type": "integer", "format": "int32" @@ -2621,19 +2383,39 @@ { "name": "pageToken", "in": "query", - "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", + "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.", "schema": { "type": "string" } - }, + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListModelsResponse" + } + } + } + } + } + } + }, + "/models/{modelsId}": { + "get": { + "description": "Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", + "operationId": "models.get", + "parameters": [ { - "name": "tunedModelsId", + "name": "modelsId", "in": "path", "required": true, - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", "schema": { "type": "string", - "pattern": "^tunedModels/[^/]+$" + "pattern": "^models/[^/]+$" } } ], @@ -2643,2088 +2425,2119 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPermissionsResponse" + "$ref": "#/components/schemas/Model" } } } } } } - } - }, - "components": { - "schemas": { - "GoogleSearch": { - "type": "object", - "description": "GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", - "properties": { - "timeRangeFilter": { - "description": "Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).", - "$ref": "#/components/schemas/Interval" - }, - "searchTypes": { - "description": "Optional. The set of search types to enable. If not set, web search is enabled by default.", - "$ref": "#/components/schemas/SearchTypes" - } - } - }, - "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "properties": { - "operations": { - "items": { - "$ref": "#/components/schemas/Operation" - }, - "type": "array", - "description": "A list of operations that matches the specified filter in the request." - }, - "unreachable": { - "items": { - "type": "string" - }, - "type": "array", - "description": "Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations." - }, - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - } - }, - "type": "object" - }, - "SafetyRating": { - "type": "object", - "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.", - "properties": { - "category": { - "type": "string", - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true - ], - "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT", - "HARM_CATEGORY_CIVIC_INTEGRITY" - ], - "description": "Required. The category for this rating.", - "x-enum-descriptions": [ - "Category is unspecified.", - "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", - "**PaLM** - Content that is rude, disrespectful, or profane.", - "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", - "**PaLM** - Contains references to sexual acts or other lewd content.", - "**PaLM** - Promotes unchecked medical advice.", - "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", - "**Gemini** - Harassment content.", - "**Gemini** - Hate speech and content.", - "**Gemini** - Sexually explicit content.", - "**Gemini** - Dangerous content.", - "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." - ] - }, - "probability": { - "description": "Required. The probability of harm for this content.", - "x-enum-descriptions": [ - "Probability is unspecified.", - "Content has a negligible chance of being unsafe.", - "Content has a low chance of being unsafe.", - "Content has a medium chance of being unsafe.", - "Content has a high chance of being unsafe." - ], - "type": "string", - "enum": [ - "HARM_PROBABILITY_UNSPECIFIED", - "NEGLIGIBLE", - "LOW", - "MEDIUM", - "HIGH" - ] - }, - "blocked": { - "description": "Was this content blocked because of this rating?", - "type": "boolean" - } - } - }, - "UsageMetadata": { - "description": "Metadata on the generation request's token usage.", - "properties": { - "toolUsePromptTokenCount": { - "format": "int32", - "readOnly": true, - "type": "integer", - "description": "Output only. Number of tokens present in tool-use prompt(s)." - }, - "candidatesTokensDetails": { - "items": { - "$ref": "#/components/schemas/ModalityTokenCount" - }, - "description": "Output only. List of modalities that were returned in the response.", - "readOnly": true, - "type": "array" - }, - "promptTokenCount": { - "format": "int32", - "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.", - "type": "integer" - }, - "promptTokensDetails": { - "items": { - "$ref": "#/components/schemas/ModalityTokenCount" - }, - "readOnly": true, - "type": "array", - "description": "Output only. List of modalities that were processed in the request input." - }, - "cachedContentTokenCount": { - "format": "int32", - "type": "integer", - "description": "Number of tokens in the cached part of the prompt (the cached content)" - }, - "thoughtsTokenCount": { - "format": "int32", - "readOnly": true, - "type": "integer", - "description": "Output only. Number of tokens of thoughts for thinking models." - }, - "cacheTokensDetails": { - "items": { - "$ref": "#/components/schemas/ModalityTokenCount" - }, - "readOnly": true, - "type": "array", - "description": "Output only. List of modalities of the cached content in the request input." - }, - "totalTokenCount": { - "format": "int32", - "description": "Total token count for the generation request (prompt + thoughts + response candidates).", - "type": "integer" - }, - "toolUsePromptTokensDetails": { - "items": { - "$ref": "#/components/schemas/ModalityTokenCount" - }, - "description": "Output only. List of modalities that were processed for tool-use request inputs.", - "readOnly": true, - "type": "array" - }, - "candidatesTokenCount": { - "type": "integer", - "description": "Total number of tokens across all the generated response candidates.", - "format": "int32" - }, - "responseTokenCount": { - "description": "Output only. Number of tokens in the response. Used by Gemini 3.1+ Live API models instead of candidatesTokenCount.", - "type": "integer", - "format": "int32", - "readOnly": true - }, - "responseTokensDetails": { - "description": "Output only. List of modalities returned in the response with per-modality token counts. Used by Gemini 3.1+ Live API models instead of candidatesTokensDetails.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/components/schemas/ModalityTokenCount" + }, + "/models/{modelsId}:batchGenerateContent": { + "post": { + "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", + "operationId": "models.batchGenerateContent", + "parameters": [ + { + "name": "modelsId", + "in": "path", + "required": true, + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "schema": { + "type": "string", + "pattern": "^models/[^/]+$" } } - }, - "type": "object" - }, - "BatchGenerateContentRequest": { - "type": "object", - "description": "Request for a `BatchGenerateContent` operation.", - "properties": { - "batch": { - "$ref": "#/components/schemas/GenerateContentBatch", - "description": "Required. The batch to create." - } - } - }, - "CreateFileResponse": { - "description": "Response for `CreateFile`.", - "properties": { - "file": { - "description": "Metadata for the created file.", - "$ref": "#/components/schemas/File" - } - }, - "type": "object" - }, - "ChunkingConfig": { - "description": "Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto", - "properties": { - "whiteSpaceConfig": { - "description": "White space chunking configuration.", - "$ref": "#/components/schemas/WhiteSpaceConfig" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchGenerateContentRequest" + } + } } }, - "type": "object" - }, - "ImageSearch": { - "description": "Image search for grounding and related configurations.", - "properties": {}, - "type": "object" - }, - "CountTokensResponse": { - "type": "object", - "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.", - "properties": { - "totalTokens": { - "format": "int32", - "description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative.", - "type": "integer" - }, - "cachedContentTokenCount": { - "format": "int32", - "description": "Number of tokens in the cached part of the prompt (the cached content).", - "type": "integer" - }, - "cacheTokensDetails": { - "readOnly": true, - "type": "array", - "description": "Output only. List of modalities that were processed in the cached content.", - "items": { - "$ref": "#/components/schemas/ModalityTokenCount" - } - }, - "promptTokensDetails": { - "description": "Output only. List of modalities that were processed in the request input.", - "readOnly": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/ModalityTokenCount" + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Operation" + } + } } } } - }, - "RetrievalConfig": { - "type": "object", - "description": "Retrieval config.", - "properties": { - "languageCode": { - "description": "Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).", - "type": "string" - }, - "latLng": { - "$ref": "#/components/schemas/LatLng", - "description": "Optional. The location of the user." - } - } - }, - "Corpus": { - "description": "A `Corpus` is a collection of `Document`s. A project can create up to 10 corpora.", - "properties": { - "displayName": { - "description": "Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", - "type": "string" - }, - "name": { - "description": "Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`", - "readOnly": true, - "type": "string" - }, - "createTime": { - "description": "Output only. The Timestamp of when the `Corpus` was created.", - "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "updateTime": { - "readOnly": true, - "type": "string", - "description": "Output only. The Timestamp of when the `Corpus` was last updated.", - "format": "google-datetime" + } + }, + "/models/{modelsId}:countTokens": { + "post": { + "description": "Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.", + "operationId": "models.countTokens", + "parameters": [ + { + "name": "modelsId", + "in": "path", + "required": true, + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "schema": { + "type": "string", + "pattern": "^models/[^/]+$" + } } - }, - "type": "object" - }, - "PromptFeedback": { - "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", - "properties": { - "blockReason": { - "type": "string", - "enum": [ - "BLOCK_REASON_UNSPECIFIED", - "SAFETY", - "OTHER", - "BLOCKLIST", - "PROHIBITED_CONTENT", - "IMAGE_SAFETY" - ], - "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.", - "x-enum-descriptions": [ - "Default value. This value is unused.", - "Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", - "Prompt was blocked due to unknown reasons.", - "Prompt was blocked due to the terms which are included from the terminology blocklist.", - "Prompt was blocked due to prohibited content.", - "Candidates blocked due to unsafe image generation content." - ] - }, - "safetyRatings": { - "items": { - "$ref": "#/components/schemas/SafetyRating" - }, - "type": "array", - "description": "Ratings for safety of the prompt. There is at most one rating per category." + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CountTokensRequest" + } + } } }, - "type": "object" - }, - "TunedModelSource": { - "type": "object", - "description": "Tuned model as a source for training a new model.", - "properties": { - "tunedModel": { - "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`", - "type": "string" - }, - "baseModel": { - "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`", - "readOnly": true, - "type": "string" + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CountTokensResponse" + } + } + } } - } - }, - "SpeechConfig": { - "description": "Config for speech generation and transcription.", - "properties": { - "languageCode": { - "description": "Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`.", - "type": "string" - }, - "multiSpeakerVoiceConfig": { - "description": "Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.", - "$ref": "#/components/schemas/MultiSpeakerVoiceConfig" - }, - "voiceConfig": { - "description": "The configuration in case of single-voice output.", - "$ref": "#/components/schemas/VoiceConfig" + } + } + }, + "/models/{modelsId}:asyncBatchEmbedContent": { + "post": { + "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", + "operationId": "models.asyncBatchEmbedContent", + "parameters": [ + { + "name": "modelsId", + "in": "path", + "required": true, + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "schema": { + "type": "string", + "pattern": "^models/[^/]+$" + } } - }, - "type": "object" - }, - "EmbedContentRequest": { - "description": "Request containing the `Content` for the model to embed.", - "properties": { - "title": { - "description": "Optional. Deprecated: Please use EmbedContentConfig.title instead. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval.", - "type": "string", - "deprecated": true - }, - "model": { - "type": "string", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`" - }, - "taskType": { - "x-enum-descriptions": [ - "Unset value, which will default to one of the other enum values.", - "Specifies the given text is a query in a search/retrieval setting.", - "Specifies the given text is a document from the corpus being searched.", - "Specifies the given text will be used for STS.", - "Specifies that the given text will be classified.", - "Specifies that the embeddings will be used for clustering.", - "Specifies that the given text will be used for question answering.", - "Specifies that the given text will be used for fact verification.", - "Specifies that the given text will be used for code retrieval." - ], - "deprecated": true, - "description": "Optional. Deprecated: Please use EmbedContentConfig.task_type instead. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`).", - "type": "string", - "enum": [ - "TASK_TYPE_UNSPECIFIED", - "RETRIEVAL_QUERY", - "RETRIEVAL_DOCUMENT", - "SEMANTIC_SIMILARITY", - "CLASSIFICATION", - "CLUSTERING", - "QUESTION_ANSWERING", - "FACT_VERIFICATION", - "CODE_RETRIEVAL_QUERY" - ] - }, - "embedContentConfig": { - "$ref": "#/components/schemas/EmbedContentConfig", - "description": "Optional. Configuration for the EmbedContent request." - }, + ], + "requestBody": { "content": { - "description": "Required. The content to embed. Only the `parts.text` fields will be counted.", - "$ref": "#/components/schemas/Content" - }, - "outputDimensionality": { - "type": "integer", - "description": "Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`).", - "format": "int32", - "deprecated": true + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncBatchEmbedContentRequest" + } + } } }, - "type": "object" - }, - "GenerateContentRequest": { - "description": "Request to generate a completion from the model.", - "properties": { - "contents": { - "type": "array", - "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.", - "items": { - "$ref": "#/components/schemas/Content" + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Operation" + } + } + } + } + } + } + }, + "/models/{modelsId}/operations": { + "get": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "operationId": "models.operations.list", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "The standard list filter.", + "schema": { + "type": "string" } }, - "toolConfig": { - "description": "Optional. Tool configuration for any `Tool` specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example.", - "$ref": "#/components/schemas/ToolConfig" + { + "name": "modelsId", + "in": "path", + "required": true, + "description": "The name of the operation's parent resource.", + "schema": { + "type": "string", + "pattern": "^models/[^/]+$" + } }, - "model": { - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." + { + "name": "pageSize", + "in": "query", + "description": "The standard list page size.", + "schema": { + "type": "integer", + "format": "int32" + } }, - "systemInstruction": { - "description": "Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.", - "$ref": "#/components/schemas/Content" + { + "name": "pageToken", + "in": "query", + "description": "The standard list page token.", + "schema": { + "type": "string" + } }, - "cachedContent": { - "description": "Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`", - "type": "string" + { + "name": "returnPartialSuccess", + "in": "query", + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOperationsResponse" + } + } + } + } + } + } + }, + "/models/{modelsId}/operations/{operationsId}": { + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "operationId": "models.operations.get", + "parameters": [ + { + "name": "operationsId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } }, - "serviceTier": { + { + "name": "modelsId", + "in": "path", + "required": true, + "description": "The name of the operation resource.", + "schema": { + "type": "string", + "pattern": "^models/[^/]+/operations/[^/]+$" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Operation" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "FunctionCallingConfig": { + "type": "object", + "description": "Configuration for specifying function calling behavior.", + "properties": { + "mode": { + "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.", "type": "string", - "enum": [ - "unspecified", - "standard", - "flex", - "priority" - ], - "description": "Optional. The service tier of the request.", "x-enum-descriptions": [ - "Default service tier, which is standard.", - "Standard service tier.", - "Flex service tier.", - "Priority service tier." + "Unspecified function calling mode. This value should not be used.", + "Default model behavior, model decides to predict either a function call or a natural language response.", + "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".", + "Model will not predict any function call. Model behavior is same as when not passing any function declarations.", + "Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\"." + ], + "enum": [ + "MODE_UNSPECIFIED", + "AUTO", + "ANY", + "NONE", + "VALIDATED" ] }, - "tools": { - "items": { - "$ref": "#/components/schemas/Tool" - }, - "description": "Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.", - "type": "array" - }, - "safetySettings": { + "allowedFunctionNames": { "type": "array", - "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", - "items": { - "$ref": "#/components/schemas/SafetySetting" - } - }, - "generationConfig": { - "$ref": "#/components/schemas/GenerationConfig", - "description": "Optional. Configuration options for model generation and outputs." - }, - "store": { - "type": "boolean", - "description": "Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config." + "description": "Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names.", + "items": { + "type": "string" + } } - }, - "type": "object" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", - "properties": {}, - "type": "object" + } }, - "Schema": { - "description": "The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).", + "UrlMetadata": { + "type": "object", + "description": "Context of the a single url retrieval.", "properties": { - "properties": { - "description": "Optional. Properties of Type.OBJECT.", - "additionalProperties": { - "$ref": "#/components/schemas/Schema" - }, - "type": "object" - }, - "anyOf": { - "items": { - "$ref": "#/components/schemas/Schema" - }, - "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.", - "type": "array" - }, - "maxProperties": { - "type": "string", - "description": "Optional. Maximum number of the properties for Type.OBJECT.", - "format": "int64" - }, - "format": { - "type": "string", - "description": "Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality." - }, - "pattern": { - "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.", - "type": "string" - }, - "title": { - "description": "Optional. The title of the schema.", - "type": "string" - }, - "maxItems": { - "format": "int64", + "retrievedUrl": { "type": "string", - "description": "Optional. Maximum number of the elements for Type.ARRAY." - }, - "minProperties": { - "format": "int64", - "description": "Optional. Minimum number of the properties for Type.OBJECT.", - "type": "string" + "description": "Retrieved url by the tool." }, - "maxLength": { - "description": "Optional. Maximum length of the Type.STRING", + "urlRetrievalStatus": { + "description": "Status of the url retrieval.", "type": "string", - "format": "int64" - }, - "type": { - "description": "Required. Data type.", "x-enum-descriptions": [ - "Not specified, should not be used.", - "String type.", - "Number type.", - "Integer type.", - "Boolean type.", - "Array type.", - "Object type.", - "Null type." + "Default value. This value is unused.", + "Url retrieval is successful.", + "Url retrieval is failed due to error.", + "Url retrieval is failed because the content is behind paywall.", + "Url retrieval is failed because the content is unsafe." ], - "type": "string", "enum": [ - "TYPE_UNSPECIFIED", - "STRING", - "NUMBER", - "INTEGER", - "BOOLEAN", - "ARRAY", - "OBJECT", - "NULL" + "URL_RETRIEVAL_STATUS_UNSPECIFIED", + "URL_RETRIEVAL_STATUS_SUCCESS", + "URL_RETRIEVAL_STATUS_ERROR", + "URL_RETRIEVAL_STATUS_PAYWALL", + "URL_RETRIEVAL_STATUS_UNSAFE" ] - }, - "minItems": { - "format": "int64", + } + } + }, + "SearchEntryPoint": { + "type": "object", + "description": "Google search entry point.", + "properties": { + "renderedContent": { "type": "string", - "description": "Optional. Minimum number of the elements for Type.ARRAY." + "description": "Optional. Web content snippet that can be embedded in a web page or an app webview." }, - "minLength": { + "sdkBlob": { "type": "string", - "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING", - "format": "int64" + "description": "Optional. Base64 encoded JSON representing array of tuple.", + "format": "byte" + } + } + }, + "RetrievalConfig": { + "description": "Retrieval config.", + "properties": { + "latLng": { + "description": "Optional. The location of the user.", + "$ref": "#/components/schemas/LatLng" }, - "default": { - "description": "Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors." + "languageCode": { + "description": "Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).", + "type": "string" + } + }, + "type": "object" + }, + "LatLng": { + "type": "object", + "description": "An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.", + "properties": { + "longitude": { + "type": "number", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double" }, - "nullable": { - "description": "Optional. Indicates if the value may be null.", - "type": "boolean" + "latitude": { + "type": "number", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double" + } + } + }, + "GroundingChunk": { + "description": "A `GroundingChunk` represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps.", + "properties": { + "web": { + "$ref": "#/components/schemas/Web", + "description": "Grounding chunk from the web." }, - "description": { - "type": "string", - "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown." + "image": { + "description": "Optional. Grounding chunk from image search.", + "$ref": "#/components/schemas/Image" }, - "enum": { - "items": { - "type": "string" - }, - "type": "array", - "description": "Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]}" + "retrievedContext": { + "description": "Optional. Grounding chunk from context retrieved by the file search tool.", + "$ref": "#/components/schemas/RetrievedContext" }, - "propertyOrdering": { - "type": "array", - "description": "Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.", - "items": { - "type": "string" - } + "maps": { + "$ref": "#/components/schemas/Maps", + "description": "Optional. Grounding chunk from Google Maps." + } + }, + "type": "object" + }, + "CustomMetadata": { + "type": "object", + "description": "User provided metadata stored as key-value pairs.", + "properties": { + "stringValue": { + "description": "The string value of the metadata to store.", + "type": "string" }, - "required": { - "description": "Optional. Required properties of Type.OBJECT.", - "type": "array", - "items": { - "type": "string" - } + "stringListValue": { + "$ref": "#/components/schemas/StringList", + "description": "The StringList value of the metadata to store." }, - "minimum": { - "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER", - "type": "number", - "format": "double" + "numericValue": { + "description": "The numeric value of the metadata to store.", + "format": "float", + "type": "number" }, - "maximum": { - "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER", - "type": "number", - "format": "double" + "key": { + "description": "Required. The key of the metadata to store.", + "type": "string" + } + } + }, + "SpeechConfig": { + "description": "Config for speech generation and transcription.", + "properties": { + "multiSpeakerVoiceConfig": { + "description": "Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.", + "$ref": "#/components/schemas/MultiSpeakerVoiceConfig" }, - "items": { - "description": "Optional. Schema of the elements of Type.ARRAY.", - "$ref": "#/components/schemas/Schema" + "voiceConfig": { + "$ref": "#/components/schemas/VoiceConfig", + "description": "The configuration in case of single-voice output." }, - "example": { - "description": "Optional. Example of the object. Will only populated when the object is the root." + "languageCode": { + "description": "Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`.", + "type": "string" } }, "type": "object" }, - "Permission": { - "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete", + "EmbedContentConfig": { + "description": "Configurations for the EmbedContent request.", "properties": { - "name": { - "readOnly": true, - "type": "string", - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only." + "documentOcr": { + "type": "boolean", + "description": "Optional. Whether to enable OCR for document content." }, - "role": { - "description": "Required. The role granted by this permission.", - "x-enum-descriptions": [ - "The default value. This value is unused.", - "Owner can use, update, share and delete the resource.", - "Writer can use, update and share the resource.", - "Reader can use the resource." - ], + "title": { "type": "string", - "enum": [ - "ROLE_UNSPECIFIED", - "OWNER", - "WRITER", - "READER" - ] + "description": "Optional. The title for the text." }, - "granteeType": { - "description": "Optional. Immutable. The type of the grantee.", + "taskType": { + "description": "Optional. The task type of the embedding.", + "type": "string", "x-enum-descriptions": [ - "The default value. This value is unused.", - "Represents a user. When set, you must provide email_address for the user.", - "Represents a group. When set, you must provide email_address for the group.", - "Represents access to everyone. No extra information is required." + "Unset value, which will default to one of the other enum values.", + "Specifies the given text is a query in a search/retrieval setting.", + "Specifies the given text is a document from the corpus being searched.", + "Specifies the given text will be used for STS.", + "Specifies that the given text will be classified.", + "Specifies that the embeddings will be used for clustering.", + "Specifies that the given text will be used for question answering.", + "Specifies that the given text will be used for fact verification.", + "Specifies that the given text will be used for code retrieval." ], - "type": "string", "enum": [ - "GRANTEE_TYPE_UNSPECIFIED", - "USER", - "GROUP", - "EVERYONE" + "TASK_TYPE_UNSPECIFIED", + "RETRIEVAL_QUERY", + "RETRIEVAL_DOCUMENT", + "SEMANTIC_SIMILARITY", + "CLASSIFICATION", + "CLUSTERING", + "QUESTION_ANSWERING", + "FACT_VERIFICATION", + "CODE_RETRIEVAL_QUERY" ] }, - "emailAddress": { - "type": "string", - "description": "Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE." - } - }, - "type": "object" - }, - "FileData": { - "description": "URI based data.", - "properties": { - "mimeType": { - "description": "Optional. The IANA standard MIME type of the source data.", - "type": "string" + "outputDimensionality": { + "type": "integer", + "description": "Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end.", + "format": "int32" }, - "fileUri": { - "description": "Required. URI.", - "type": "string" + "autoTruncate": { + "description": "Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length.", + "type": "boolean" + }, + "audioTrackExtraction": { + "description": "Optional. Whether to extract audio from video content.", + "type": "boolean" } }, "type": "object" }, - "TransferOwnershipResponse": { - "type": "object", - "description": "Response from `TransferOwnership`.", - "properties": {} - }, - "TopCandidates": { - "description": "Candidates with top log probabilities at each decoding step.", + "FunctionResponsePart": { + "description": "A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", "properties": { - "candidates": { - "items": { - "$ref": "#/components/schemas/LogprobsResultCandidate" - }, - "type": "array", - "description": "Sorted by log probability in descending order." + "inlineData": { + "description": "Inline media bytes.", + "$ref": "#/components/schemas/FunctionResponseBlob" } }, "type": "object" }, - "Document": { - "description": "A `Document` is a collection of `Chunk`s.", + "TunedModel": { + "type": "object", + "description": "A fine-tuned model created using ModelService.CreateTunedModel.", "properties": { - "updateTime": { - "readOnly": true, - "type": "string", - "description": "Output only. The Timestamp of when the `Document` was last updated.", - "format": "google-datetime" + "topP": { + "type": "number", + "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.", + "format": "float" }, - "mimeType": { + "description": { + "description": "Optional. A short description of this model.", + "type": "string" + }, + "tuningTask": { + "description": "Required. The tuning task that creates the tuned model.", + "$ref": "#/components/schemas/TuningTask" + }, + "name": { + "type": "string", "readOnly": true, + "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`" + }, + "tunedModelSource": { + "description": "Optional. TunedModel to use as the starting point for training the new model.", + "$ref": "#/components/schemas/TunedModelSource" + }, + "state": { + "x-enum-descriptions": [ + "The default value. This value is unused.", + "The model is being created.", + "The model is ready to be used.", + "The model failed to be created." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "ACTIVE", + "FAILED" + ], "type": "string", - "description": "Output only. The mime type of the Document." + "readOnly": true, + "description": "Output only. The state of the tuned model." }, "createTime": { - "description": "Output only. The Timestamp of when the `Document` was created.", + "description": "Output only. The timestamp when this model was created.", + "format": "google-datetime", "readOnly": true, - "type": "string", - "format": "google-datetime" + "type": "string" }, - "sizeBytes": { + "updateTime": { "readOnly": true, - "type": "string", - "description": "Output only. The size of raw bytes ingested into the Document.", - "format": "int64" + "description": "Output only. The timestamp when this model was updated.", + "format": "google-datetime", + "type": "string" }, - "name": { - "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"fileSearchStores/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`", + "topK": { + "description": "Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.", + "format": "int32", + "type": "integer" + }, + "baseModel": { + "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`", "type": "string" }, - "customMetadata": { - "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.", + "temperature": { + "type": "number", + "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.", + "format": "float" + }, + "readerProjectNumbers": { "type": "array", + "description": "Optional. List of project numbers that have read access to the tuned model.", "items": { - "$ref": "#/components/schemas/CustomMetadata" + "type": "string", + "format": "int64" } }, "displayName": { - "description": "Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: \"Semantic Retriever Documentation\"", - "type": "string" - }, - "state": { - "description": "Output only. Current state of the `Document`.", - "readOnly": true, "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "STATE_PENDING", - "STATE_ACTIVE", - "STATE_FAILED" - ], - "x-enum-descriptions": [ - "The default value. This value is used if the state is omitted.", - "Some `Chunks` of the `Document` are being processed (embedding and vector storage).", - "All `Chunks` of the `Document` is processed and available for querying.", - "Some `Chunks` of the `Document` failed processing." - ] + "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces." + } + } + }, + "InlinedEmbedContentResponses": { + "description": "The responses to the requests in the batch.", + "properties": { + "inlinedResponses": { + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/components/schemas/InlinedEmbedContentResponse" + }, + "description": "Output only. The responses to the requests in the batch." } }, "type": "object" }, - "EmbedContentConfig": { + "Interval": { "type": "object", - "description": "Configurations for the EmbedContent request.", + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", "properties": { - "autoTruncate": { - "description": "Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length.", - "type": "boolean" - }, - "title": { - "description": "Optional. The title for the text.", + "startTime": { + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.", + "format": "google-datetime", "type": "string" }, - "documentOcr": { - "type": "boolean", - "description": "Optional. Whether to enable OCR for document content." + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", + "format": "google-datetime", + "type": "string" + } + } + }, + "StringList": { + "description": "User provided string values assigned to a single metadata key.", + "properties": { + "values": { + "items": { + "type": "string" + }, + "description": "The string values of the metadata to store.", + "type": "array" + } + }, + "type": "object" + }, + "GenerateContentRequest": { + "type": "object", + "description": "Request to generate a completion from the model.", + "properties": { + "generationConfig": { + "$ref": "#/components/schemas/GenerationConfig", + "description": "Optional. Configuration options for model generation and outputs." }, - "outputDimensionality": { - "format": "int32", - "type": "integer", - "description": "Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end." + "tools": { + "description": "Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.", + "items": { + "$ref": "#/components/schemas/Tool" + }, + "type": "array" }, - "taskType": { + "serviceTier": { "type": "string", + "x-enum-descriptions": [ + "Default service tier, which is standard.", + "Standard service tier.", + "Flex service tier.", + "Priority service tier." + ], "enum": [ - "TASK_TYPE_UNSPECIFIED", - "RETRIEVAL_QUERY", - "RETRIEVAL_DOCUMENT", - "SEMANTIC_SIMILARITY", - "CLASSIFICATION", - "CLUSTERING", - "QUESTION_ANSWERING", - "FACT_VERIFICATION", - "CODE_RETRIEVAL_QUERY" + "unspecified", + "standard", + "flex", + "priority" ], - "description": "Optional. The task type of the embedding.", - "x-enum-descriptions": [ - "Unset value, which will default to one of the other enum values.", - "Specifies the given text is a query in a search/retrieval setting.", - "Specifies the given text is a document from the corpus being searched.", - "Specifies the given text will be used for STS.", - "Specifies that the given text will be classified.", - "Specifies that the embeddings will be used for clustering.", - "Specifies that the given text will be used for question answering.", - "Specifies that the given text will be used for fact verification.", - "Specifies that the given text will be used for code retrieval." - ] + "description": "Optional. The service tier of the request." + }, + "systemInstruction": { + "description": "Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.", + "$ref": "#/components/schemas/Content" + }, + "toolConfig": { + "$ref": "#/components/schemas/ToolConfig", + "description": "Optional. Tool configuration for any `Tool` specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example." + }, + "cachedContent": { + "description": "Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`", + "type": "string" }, - "audioTrackExtraction": { - "description": "Optional. Whether to extract audio from video content.", + "store": { + "description": "Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.", "type": "boolean" + }, + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "type": "string" + }, + "contents": { + "items": { + "$ref": "#/components/schemas/Content" + }, + "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.", + "type": "array" + }, + "safetySettings": { + "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", + "items": { + "$ref": "#/components/schemas/SafetySetting" + }, + "type": "array" } } }, - "ReviewSnippet": { + "SpeakerVoiceConfig": { "type": "object", - "description": "Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.", + "description": "The configuration for a single speaker in a multi speaker setup.", "properties": { - "googleMapsUri": { - "description": "A link that corresponds to the user review on Google Maps.", - "type": "string" + "voiceConfig": { + "description": "Required. The configuration for the voice to use.", + "$ref": "#/components/schemas/VoiceConfig" }, - "title": { - "description": "Title of the review.", + "speaker": { + "description": "Required. The name of the speaker to use. Should be the same as in the prompt.", "type": "string" - }, - "reviewId": { - "type": "string", - "description": "The ID of the review snippet." } } }, - "FileSearchStore": { - "description": "A `FileSearchStore` is a collection of `Document`s.", + "GroundingChunkCustomMetadata": { + "description": "User provided metadata about the GroundingFact.", "properties": { - "createTime": { - "format": "google-datetime", - "readOnly": true, - "type": "string", - "description": "Output only. The Timestamp of when the `FileSearchStore` was created." + "numericValue": { + "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.", + "format": "float", + "type": "number" }, - "displayName": { - "description": "Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", + "stringValue": { + "description": "Optional. The string value of the metadata.", "type": "string" }, - "pendingDocumentsCount": { - "readOnly": true, - "type": "string", - "description": "Output only. The number of documents in the `FileSearchStore` that are being processed.", - "format": "int64" + "stringListValue": { + "description": "Optional. A list of string values for the metadata.", + "$ref": "#/components/schemas/GroundingChunkStringList" }, - "embeddingModel": { - "description": "Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used.", + "key": { + "description": "The key of the metadata.", + "type": "string" + } + }, + "type": "object" + }, + "ListCorporaResponse": { + "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", + "properties": { + "corpora": { + "type": "array", + "description": "The returned corpora.", + "items": { + "$ref": "#/components/schemas/Corpus" + } + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", "type": "string" + } + }, + "type": "object" + }, + "GenerateContentBatch": { + "type": "object", + "description": "A resource representing a batch of `GenerateContent` requests.", + "properties": { + "model": { + "type": "string", + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." }, - "sizeBytes": { + "inputConfig": { + "description": "Required. Input configuration of the instances on which batch processing are performed.", + "$ref": "#/components/schemas/InputConfig" + }, + "priority": { + "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", "format": "int64", - "readOnly": true, + "type": "string" + }, + "createTime": { "type": "string", - "description": "Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`." + "readOnly": true, + "description": "Output only. The time at which the batch was created.", + "format": "google-datetime" }, - "name": { - "description": "Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the \"fileSearchStores/\" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.", + "endTime": { "readOnly": true, + "description": "Output only. The time at which the batch processing completed.", + "format": "google-datetime", "type": "string" }, "updateTime": { "readOnly": true, + "description": "Output only. The time at which the batch was last updated.", + "format": "google-datetime", + "type": "string" + }, + "state": { "type": "string", - "description": "Output only. The Timestamp of when the `FileSearchStore` was last updated.", - "format": "google-datetime" + "readOnly": true, + "description": "Output only. The state of the batch.", + "x-enum-descriptions": [ + "The batch state is unspecified.", + "The service is preparing to run the batch.", + "The batch is in progress.", + "The batch completed successfully.", + "The batch failed.", + "The batch has been cancelled.", + "The batch has expired." + ], + "enum": [ + "BATCH_STATE_UNSPECIFIED", + "BATCH_STATE_PENDING", + "BATCH_STATE_RUNNING", + "BATCH_STATE_SUCCEEDED", + "BATCH_STATE_FAILED", + "BATCH_STATE_CANCELLED", + "BATCH_STATE_EXPIRED" + ] }, - "activeDocumentsCount": { + "batchStats": { + "description": "Output only. Stats about the batch.", "readOnly": true, + "$ref": "#/components/schemas/BatchStats" + }, + "name": { "type": "string", - "description": "Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval.", - "format": "int64" + "readOnly": true, + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`." }, - "failedDocumentsCount": { - "description": "Output only. The number of documents in the `FileSearchStore` that have failed processing.", + "output": { + "description": "Output only. The output of the batch request.", "readOnly": true, - "type": "string", - "format": "int64" - } - }, - "type": "object" - }, - "ListPermissionsResponse": { - "type": "object", - "description": "Response from `ListPermissions` containing a paginated list of permissions.", - "properties": { - "permissions": { - "items": { - "$ref": "#/components/schemas/Permission" - }, - "type": "array", - "description": "Returned permissions." + "$ref": "#/components/schemas/GenerateContentBatchOutput" }, - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." - } - } - }, - "GoogleSearchRetrieval": { - "type": "object", - "description": "Tool to retrieve public web data for grounding, powered by Google.", - "properties": { - "dynamicRetrievalConfig": { - "description": "Specifies the dynamic retrieval configuration for the given source.", - "$ref": "#/components/schemas/DynamicRetrievalConfig" + "displayName": { + "description": "Required. The user-defined name of this batch.", + "type": "string" } } }, - "PrebuiltVoiceConfig": { - "type": "object", - "description": "The configuration for the prebuilt speaker to use.", + "TopCandidates": { + "description": "Candidates with top log probabilities at each decoding step.", "properties": { - "voiceName": { - "type": "string", - "description": "The name of the preset voice to use." + "candidates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogprobsResultCandidate" + }, + "description": "Sorted by log probability in descending order." } - } + }, + "type": "object" }, - "PlaceAnswerSources": { - "type": "object", - "description": "Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: \"does Bar Foo have Wifi\" or \"is Foo Bar wheelchair accessible?\"). Currently we only support review snippets as sources.", + "CountTokensRequest": { + "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", "properties": { - "reviewSnippets": { + "contents": { + "type": "array", "items": { - "$ref": "#/components/schemas/ReviewSnippet" + "$ref": "#/components/schemas/Content" }, - "description": "Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.", - "type": "array" + "description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set." + }, + "generateContentRequest": { + "description": "Optional. The overall input given to the `Model`. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). `Model`s/`Content`s and `generate_content_request`s are mutually exclusive. You can either send `Model` + `Content`s or a `generate_content_request`, but never both.", + "$ref": "#/components/schemas/GenerateContentRequest" } - } + }, + "type": "object" }, - "ModelStatus": { - "description": "The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.", + "EmbedContentResponse": { + "description": "The response to an `EmbedContentRequest`.", "properties": { - "retirementTime": { - "format": "google-datetime", - "description": "The time at which the model will be retired.", - "type": "string" - }, - "message": { - "type": "string", - "description": "A message explaining the model status." - }, - "modelStage": { - "x-enum-descriptions": [ - "Unspecified model stage.", - "The underlying model is subject to lots of tunings.", - "Models in this stage are for experimental purposes only.", - "Models in this stage are more mature than experimental models.", - "Models in this stage are considered stable and ready for production use.", - "If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.", - "Models in this stage are deprecated. These models cannot be used.", - "Models in this stage are retired. These models cannot be used." - ], - "type": "string", - "enumDeprecated": [ - false, - true, - false, - false, - false, - false, - true, - false - ], - "enum": [ - "MODEL_STAGE_UNSPECIFIED", - "UNSTABLE_EXPERIMENTAL", - "EXPERIMENTAL", - "PREVIEW", - "STABLE", - "LEGACY", - "DEPRECATED", - "RETIRED" - ], - "description": "The stage of the underlying model." + "embedding": { + "readOnly": true, + "$ref": "#/components/schemas/ContentEmbedding", + "description": "Output only. The embedding generated from the input content." + }, + "usageMetadata": { + "description": "Output only. The usage metadata for the request.", + "readOnly": true, + "$ref": "#/components/schemas/EmbeddingUsageMetadata" } }, "type": "object" }, - "ListDocumentsResponse": { + "TuningExamples": { "type": "object", - "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", + "description": "A set of tuning examples. Can be training or validation data.", "properties": { - "documents": { - "description": "The returned `Document`s.", + "examples": { "type": "array", + "description": "The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.", "items": { - "$ref": "#/components/schemas/Document" + "$ref": "#/components/schemas/TuningExample" } - }, - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." } } }, - "LogprobsResultCandidate": { - "type": "object", - "description": "Candidate for the logprobs token and score.", + "GenerateContentResponse": { + "description": "Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`.", "properties": { - "token": { - "description": "The candidate\u2019s token string value.", + "modelVersion": { + "description": "Output only. The model version used to generate the response.", + "readOnly": true, "type": "string" }, - "tokenId": { - "type": "integer", - "description": "The candidate\u2019s token id value.", - "format": "int32" + "promptFeedback": { + "$ref": "#/components/schemas/PromptFeedback", + "description": "Returns the prompt's feedback related to the content filters." }, - "logProbability": { - "format": "float", - "type": "number", - "description": "The candidate's log probability." - } - } - }, - "ImportFileRequest": { - "description": "Request for `ImportFile` to import a File API file with a `FileSearchStore`.", - "properties": { - "customMetadata": { + "responseId": { + "type": "string", + "readOnly": true, + "description": "Output only. response_id is used to identify each response." + }, + "candidates": { "items": { - "$ref": "#/components/schemas/CustomMetadata" + "$ref": "#/components/schemas/Candidate" }, - "description": "Custom metadata to be associated with the file.", + "description": "Candidate responses from the model.", "type": "array" }, - "chunkingConfig": { - "description": "Optional. Config for telling the service how to chunk the file. If not provided, the service will use default parameters.", - "$ref": "#/components/schemas/ChunkingConfig" + "usageMetadata": { + "readOnly": true, + "$ref": "#/components/schemas/UsageMetadata", + "description": "Output only. Metadata on the generation requests' token usage." }, - "fileName": { - "type": "string", - "description": "Required. The name of the `File` to import. Example: `files/abc-123`" + "modelStatus": { + "description": "Output only. The current model status of this model.", + "readOnly": true, + "$ref": "#/components/schemas/ModelStatus" } }, "type": "object" }, - "FunctionDeclaration": { - "type": "object", - "description": "Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.", + "Maps": { + "description": "A grounding chunk from Google Maps. A Maps chunk corresponds to a single place.", "properties": { - "description": { - "description": "Required. A brief description of the function.", + "placeId": { + "description": "The ID of the place, in `places/{place_id}` format. A user can use this ID to look up that place.", "type": "string" }, - "parametersJsonSchema": { - "description": "Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" }, \"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\", \"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive with `parameters`." - }, - "response": { - "$ref": "#/components/schemas/Schema", - "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function." + "placeAnswerSources": { + "$ref": "#/components/schemas/PlaceAnswerSources", + "description": "Sources that provide answers about the features of a given place in Google Maps." }, - "name": { - "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128.", + "uri": { + "description": "URI reference of the place.", "type": "string" }, - "behavior": { - "description": "Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.", - "x-enum-descriptions": [ - "This value is unused.", - "If set, the system will wait to receive the function response before continuing the conversation.", - "If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model." - ], - "type": "string", - "enum": [ - "UNSPECIFIED", - "BLOCKING", - "NON_BLOCKING" - ] - }, - "parameters": { - "$ref": "#/components/schemas/Schema", - "description": "Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter." - }, - "responseJsonSchema": { - "description": "Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`." - } - } - }, - "ThinkingConfig": { - "description": "Config for thinking features.", - "properties": { - "includeThoughts": { - "type": "boolean", - "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only when available." - }, - "thinkingBudget": { - "format": "int32", - "description": "The number of thoughts tokens that the model should generate.", - "type": "integer" + "text": { + "description": "Text description of the place answer.", + "type": "string" }, - "thinkingLevel": { - "description": "Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error.", - "x-enum-descriptions": [ - "Default value.", - "Little to no thinking.", - "Low thinking level.", - "Medium thinking level.", - "High thinking level." - ], - "type": "string", - "enum": [ - "THINKING_LEVEL_UNSPECIFIED", - "MINIMAL", - "LOW", - "MEDIUM", - "HIGH" - ] + "title": { + "description": "Title of the place.", + "type": "string" } }, "type": "object" }, - "CountTokensRequest": { - "type": "object", - "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", + "TunedModelSource": { + "description": "Tuned model as a source for training a new model.", "properties": { - "contents": { - "items": { - "$ref": "#/components/schemas/Content" - }, - "type": "array", - "description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set." + "tunedModel": { + "type": "string", + "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`" }, - "generateContentRequest": { - "$ref": "#/components/schemas/GenerateContentRequest", - "description": "Optional. The overall input given to the `Model`. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). `Model`s/`Content`s and `generate_content_request`s are mutually exclusive. You can either send `Model` + `Content`s or a `generate_content_request`, but never both." - } - } - }, - "InlinedEmbedContentResponses": { - "description": "The responses to the requests in the batch.", - "properties": { - "inlinedResponses": { + "baseModel": { "readOnly": true, - "type": "array", - "description": "Output only. The responses to the requests in the batch.", - "items": { - "$ref": "#/components/schemas/InlinedEmbedContentResponse" - } + "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`", + "type": "string" } }, "type": "object" }, - "WhiteSpaceConfig": { - "type": "object", - "description": "Configuration for a white space chunking algorithm [white space delimited].", - "properties": { - "maxTokensPerChunk": { - "type": "integer", - "description": "Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow.", - "format": "int32" - }, - "maxOverlapTokens": { - "format": "int32", - "type": "integer", - "description": "Maximum number of overlapping tokens between two adjacent chunks." - } - } - }, "BatchEmbedContentsResponse": { "description": "The response to a `BatchEmbedContentsRequest`.", "properties": { - "embeddings": { + "usageMetadata": { + "description": "Output only. The usage metadata for the request.", "readOnly": true, + "$ref": "#/components/schemas/EmbeddingUsageMetadata" + }, + "embeddings": { "type": "array", "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.", + "readOnly": true, "items": { "$ref": "#/components/schemas/ContentEmbedding" } - }, - "usageMetadata": { - "description": "Output only. The usage metadata for the request.", - "readOnly": true, - "$ref": "#/components/schemas/EmbeddingUsageMetadata" } }, "type": "object" }, - "VideoFileMetadata": { - "description": "Metadata for a video `File`.", + "ToolConfig": { + "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", "properties": { - "videoDuration": { - "description": "Duration of the video.", - "type": "string", - "format": "google-duration" + "includeServerSideToolInvocations": { + "type": "boolean", + "description": "Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions." + }, + "retrievalConfig": { + "$ref": "#/components/schemas/RetrievalConfig", + "description": "Optional. Retrieval config." + }, + "functionCallingConfig": { + "$ref": "#/components/schemas/FunctionCallingConfig", + "description": "Optional. Function calling config." } }, "type": "object" }, - "TransferOwnershipRequest": { - "type": "object", - "description": "Request to transfer the ownership of the tuned model.", + "InputEmbedContentConfig": { + "description": "Configures the input to the batch request.", "properties": { - "emailAddress": { - "description": "Required. The email address of the user to whom the tuned model is being transferred to.", - "type": "string" + "fileName": { + "type": "string", + "description": "The name of the `File` containing the input requests." + }, + "requests": { + "description": "The requests to be processed in the batch.", + "$ref": "#/components/schemas/InlinedEmbedContentRequests" } - } + }, + "type": "object" }, - "EmbedContentBatch": { - "description": "A resource representing a batch of `EmbedContent` requests.", + "File": { + "type": "object", + "description": "A file uploaded to the API. Next ID: 15", "properties": { - "displayName": { - "type": "string", - "description": "Required. The user-defined name of this batch." - }, - "state": { - "x-enum-descriptions": [ - "The batch state is unspecified.", - "The service is preparing to run the batch.", - "The batch is in progress.", - "The batch completed successfully.", - "The batch failed.", - "The batch has been cancelled.", - "The batch has expired." - ], - "readOnly": true, - "type": "string", - "enum": [ - "BATCH_STATE_UNSPECIFIED", - "BATCH_STATE_PENDING", - "BATCH_STATE_RUNNING", - "BATCH_STATE_SUCCEEDED", - "BATCH_STATE_FAILED", - "BATCH_STATE_CANCELLED", - "BATCH_STATE_EXPIRED" - ], - "description": "Output only. The state of the batch." + "sizeBytes": { + "readOnly": true, + "description": "Output only. Size of the file in bytes.", + "format": "int64", + "type": "string" }, - "model": { + "expirationTime": { "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." - }, - "createTime": { - "format": "google-datetime", - "description": "Output only. The time at which the batch was created.", "readOnly": true, - "type": "string" + "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.", + "format": "google-datetime" }, - "inputConfig": { - "$ref": "#/components/schemas/InputEmbedContentConfig", - "description": "Required. Input configuration of the instances on which batch processing are performed." + "downloadUri": { + "type": "string", + "description": "Output only. The download uri of the `File`.", + "readOnly": true }, - "output": { + "error": { + "description": "Output only. Error status if File processing failed.", "readOnly": true, - "$ref": "#/components/schemas/EmbedContentBatchOutput", - "description": "Output only. The output of the batch request." + "$ref": "#/components/schemas/Status" }, - "updateTime": { - "format": "google-datetime", + "name": { + "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`", + "type": "string" + }, + "sha256Hash": { + "description": "Output only. SHA-256 hash of the uploaded bytes.", + "format": "byte", "readOnly": true, + "type": "string" + }, + "source": { "type": "string", - "description": "Output only. The time at which the batch was last updated." + "x-enum-descriptions": [ + "Used if source is not specified.", + "Indicates the file is uploaded by the user.", + "Indicates the file is generated by Google.", + "Indicates the file is a registered, i.e. a Google Cloud Storage file." + ], + "enum": [ + "SOURCE_UNSPECIFIED", + "UPLOADED", + "GENERATED", + "REGISTERED" + ], + "description": "Source of the File." }, - "batchStats": { + "createTime": { + "type": "string", "readOnly": true, - "$ref": "#/components/schemas/EmbedContentBatchStats", - "description": "Output only. Stats about the batch." + "description": "Output only. The timestamp of when the `File` was created.", + "format": "google-datetime" }, - "endTime": { - "readOnly": true, + "updateTime": { "type": "string", - "description": "Output only. The time at which the batch processing completed.", + "readOnly": true, + "description": "Output only. The timestamp of when the `File` was last updated.", "format": "google-datetime" }, - "priority": { - "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", + "state": { + "x-enum-descriptions": [ + "The default value. This value is used if the state is omitted.", + "File is being processed and cannot be used for inference yet.", + "File is processed and available for inference.", + "File failed processing." + ], + "enum": [ + "STATE_UNSPECIFIED", + "PROCESSING", + "ACTIVE", + "FAILED" + ], + "readOnly": true, + "description": "Output only. Processing state of the File.", + "type": "string" + }, + "uri": { "type": "string", - "format": "int64" + "readOnly": true, + "description": "Output only. The uri of the `File`." }, - "name": { + "videoMetadata": { + "description": "Output only. Metadata for a video.", "readOnly": true, + "$ref": "#/components/schemas/VideoFileMetadata" + }, + "displayName": { + "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"", + "type": "string" + }, + "mimeType": { "type": "string", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`." + "description": "Output only. MIME type of the file.", + "readOnly": true } - }, - "type": "object" + } }, - "InlinedResponses": { + "TransferOwnershipRequest": { "type": "object", - "description": "The responses to the requests in the batch.", + "description": "Request to transfer the ownership of the tuned model.", "properties": { - "inlinedResponses": { - "readOnly": true, - "type": "array", - "description": "Output only. The responses to the requests in the batch.", - "items": { - "$ref": "#/components/schemas/InlinedResponse" - } + "emailAddress": { + "type": "string", + "description": "Required. The email address of the user to whom the tuned model is being transferred to." } } }, - "RetrievedContext": { - "type": "object", - "description": "Chunk from context retrieved by the file search tool.", + "PrebuiltVoiceConfig": { + "description": "The configuration for the prebuilt speaker to use.", "properties": { - "uri": { - "description": "Optional. URI reference of the semantic retrieval document.", + "voiceName": { + "description": "The name of the preset voice to use.", + "type": "string" + } + }, + "type": "object" + }, + "ChunkingConfig": { + "description": "Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto", + "properties": { + "whiteSpaceConfig": { + "description": "White space chunking configuration.", + "$ref": "#/components/schemas/WhiteSpaceConfig" + } + }, + "type": "object" + }, + "EmbedContentBatchOutput": { + "description": "The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.", + "properties": { + "responsesFile": { + "readOnly": true, + "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", "type": "string" }, - "title": { - "type": "string", - "description": "Optional. Title of the document." - }, - "mediaId": { - "type": "string", - "description": "Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}" - }, - "customMetadata": { + "inlinedResponses": { + "readOnly": true, + "$ref": "#/components/schemas/InlinedEmbedContentResponses", + "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests." + } + }, + "type": "object" + }, + "ListGeneratedFilesResponse": { + "description": "Response for `ListGeneratedFiles`.", + "properties": { + "generatedFiles": { "items": { - "$ref": "#/components/schemas/GroundingChunkCustomMetadata" + "$ref": "#/components/schemas/GeneratedFile" }, - "type": "array", - "description": "Optional. User-provided metadata about the retrieved context." - }, - "fileSearchStore": { - "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`", - "type": "string" + "description": "The list of `GeneratedFile`s.", + "type": "array" }, - "text": { - "description": "Optional. Text of the chunk.", + "nextPageToken": { + "description": "A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call.", "type": "string" - }, - "pageNumber": { + } + }, + "type": "object" + }, + "EmbeddingUsageMetadata": { + "type": "object", + "description": "Metadata on the usage of the embedding request.", + "properties": { + "promptTokenCount": { + "description": "Output only. Number of tokens in the prompt.", "format": "int32", - "description": "Optional. Page number of the retrieved context, if applicable.", + "readOnly": true, "type": "integer" + }, + "promptTokenDetails": { + "description": "Output only. List of modalities that were processed in the request input.", + "readOnly": true, + "items": { + "$ref": "#/components/schemas/ModalityTokenCount" + }, + "type": "array" } } }, - "InlinedRequests": { + "ListFileSearchStoresResponse": { "type": "object", - "description": "The requests to be processed in the batch if provided as part of the batch creation request.", + "description": "Response from `ListFileSearchStores` containing a paginated list of `FileSearchStores`. The results are sorted by ascending `file_search_store.create_time`.", "properties": { - "requests": { + "fileSearchStores": { + "type": "array", "items": { - "$ref": "#/components/schemas/InlinedRequest" + "$ref": "#/components/schemas/FileSearchStore" }, - "type": "array", - "description": "Required. The requests to be processed in the batch." + "description": "The returned rag_stores." + }, + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." } } }, - "StringList": { + "BatchEmbedContentsRequest": { "type": "object", - "description": "User provided string values assigned to a single metadata key.", + "description": "Batch request to get embeddings from the model for a list of prompts.", "properties": { - "values": { + "requests": { "items": { - "type": "string" + "$ref": "#/components/schemas/EmbedContentRequest" }, - "description": "The string values of the metadata to store.", + "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.", "type": "array" } } }, - "EmbedContentResponse": { + "TuningSnapshot": { "type": "object", - "description": "The response to an `EmbedContentRequest`.", + "description": "Record for a single tuning step.", "properties": { - "embedding": { + "step": { "readOnly": true, - "$ref": "#/components/schemas/ContentEmbedding", - "description": "Output only. The embedding generated from the input content." + "description": "Output only. The tuning step.", + "format": "int32", + "type": "integer" }, - "usageMetadata": { - "description": "Output only. The usage metadata for the request.", + "meanLoss": { "readOnly": true, - "$ref": "#/components/schemas/EmbeddingUsageMetadata" + "description": "Output only. The mean loss of the training examples for this step.", + "format": "float", + "type": "number" + }, + "epoch": { + "type": "integer", + "description": "Output only. The epoch this step was part of.", + "format": "int32", + "readOnly": true + }, + "computeTime": { + "type": "string", + "description": "Output only. The timestamp when this metric was computed.", + "format": "google-datetime", + "readOnly": true } } }, - "CitationMetadata": { - "description": "A collection of source attributions for a piece of content.", + "SemanticRetrieverChunk": { + "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", "properties": { - "citationSources": { - "items": { - "$ref": "#/components/schemas/CitationSource" - }, - "description": "Citations to sources for a specific response.", - "type": "array" + "chunk": { + "readOnly": true, + "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`", + "type": "string" + }, + "source": { + "type": "string", + "readOnly": true, + "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`" } }, "type": "object" }, - "EmbeddingUsageMetadata": { - "description": "Metadata on the usage of the embedding request.", + "GroundingMetadata": { + "description": "Metadata returned to client when grounding is enabled.", "properties": { - "promptTokenCount": { - "format": "int32", - "readOnly": true, - "type": "integer", - "description": "Output only. Number of tokens in the prompt." + "webSearchQueries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Web search queries for the following-up web search." }, - "promptTokenDetails": { - "readOnly": true, + "groundingChunks": { "type": "array", - "description": "Output only. List of modalities that were processed in the request input.", + "description": "List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses.", "items": { - "$ref": "#/components/schemas/ModalityTokenCount" + "$ref": "#/components/schemas/GroundingChunk" } + }, + "groundingSupports": { + "items": { + "$ref": "#/components/schemas/GoogleAiGenerativelanguageV1betaGroundingSupport" + }, + "description": "List of grounding support.", + "type": "array" + }, + "googleMapsWidgetContextToken": { + "description": "Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled.", + "type": "string" + }, + "searchEntryPoint": { + "description": "Optional. Google search entry for the following-up web searches.", + "$ref": "#/components/schemas/SearchEntryPoint" + }, + "imageSearchQueries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Image search queries used for grounding." + }, + "retrievalMetadata": { + "description": "Metadata related to retrieval in the grounding flow.", + "$ref": "#/components/schemas/RetrievalMetadata" } }, "type": "object" }, - "EmbedContentBatchStats": { - "description": "Stats about the batch.", + "Content": { + "description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.", "properties": { - "requestCount": { - "format": "int64", - "description": "Output only. The number of requests in the batch.", - "readOnly": true, - "type": "string" - }, - "successfulRequestCount": { - "format": "int64", - "readOnly": true, - "type": "string", - "description": "Output only. The number of requests that were successfully processed." + "parts": { + "type": "array", + "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.", + "items": { + "$ref": "#/components/schemas/Part" + } }, - "pendingRequestCount": { - "description": "Output only. The number of requests that are still pending processing.", - "readOnly": true, + "role": { "type": "string", - "format": "int64" - }, - "failedRequestCount": { - "format": "int64", - "description": "Output only. The number of requests that failed to be processed.", - "readOnly": true, - "type": "string" + "description": "Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset." } }, "type": "object" }, - "GroundingChunkStringList": { + "InlinedEmbedContentRequests": { "type": "object", - "description": "A list of string values.", + "description": "The requests to be processed in the batch if provided as part of the batch creation request.", "properties": { - "values": { + "requests": { "items": { - "type": "string" + "$ref": "#/components/schemas/InlinedEmbedContentRequest" }, - "description": "The string values of the list.", + "description": "Required. The requests to be processed in the batch.", "type": "array" } } }, - "Dataset": { - "type": "object", - "description": "Dataset for training or validation.", + "InlinedRequests": { + "description": "The requests to be processed in the batch if provided as part of the batch creation request.", "properties": { - "examples": { - "description": "Optional. Inline examples with simple input/output text.", - "$ref": "#/components/schemas/TuningExamples" + "requests": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InlinedRequest" + }, + "description": "Required. The requests to be processed in the batch." } - } + }, + "type": "object" }, - "GroundingPassageId": { + "Model": { "type": "object", - "description": "Identifier for a part within a `GroundingPassage`.", + "description": "Information about a Generative Language Model.", "properties": { - "passageId": { - "readOnly": true, + "maxTemperature": { + "description": "The maximum temperature this model can use.", + "format": "float", + "type": "number" + }, + "topK": { + "type": "integer", + "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.", + "format": "int32" + }, + "inputTokenLimit": { + "type": "integer", + "description": "Maximum number of input tokens allowed for this model.", + "format": "int32" + }, + "version": { + "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)", + "type": "string" + }, + "thinking": { + "description": "Whether the model supports thinking.", + "type": "boolean" + }, + "baseModelId": { "type": "string", - "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`." + "description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`" }, - "partIndex": { - "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", - "readOnly": true, + "displayName": { + "type": "string", + "description": "The human-readable name of the model. E.g. \"Gemini 1.5 Flash\". The name can be up to 128 characters long and can consist of any UTF-8 characters." + }, + "outputTokenLimit": { "type": "integer", + "description": "Maximum number of output tokens available for this model.", "format": "int32" - } - } - }, - "ListGeneratedFilesResponse": { - "type": "object", - "description": "Response for `ListGeneratedFiles`.", - "properties": { - "nextPageToken": { - "description": "A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call.", + }, + "temperature": { + "description": "Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.", + "format": "float", + "type": "number" + }, + "topP": { + "description": "For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.", + "format": "float", + "type": "number" + }, + "description": { + "description": "A short description of the model.", "type": "string" }, - "generatedFiles": { + "supportedGenerationMethods": { "items": { - "$ref": "#/components/schemas/GeneratedFile" + "type": "string" }, - "description": "The list of `GeneratedFile`s.", + "description": "The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.", "type": "array" - } - } - }, - "CitationSource": { - "type": "object", - "description": "A citation to a source for a portion of a specific response.", - "properties": { - "startIndex": { - "format": "int32", - "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.", - "type": "integer" - }, - "uri": { - "type": "string", - "description": "Optional. URI that is attributed as a source for a portion of the text." }, - "license": { - "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.", + "name": { + "description": "Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/gemini-1.5-flash-001`", "type": "string" - }, - "endIndex": { - "format": "int32", - "description": "Optional. End of the attributed segment, exclusive.", - "type": "integer" } } }, - "Blob": { + "CodeExecution": { + "description": "Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.", + "properties": {}, + "type": "object" + }, + "FunctionResponseBlob": { "type": "object", - "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.", + "description": "Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.", "properties": { "mimeType": { - "description": "The IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: text/plain, text/html, text/css, text/javascript, text/x-typescript, text/csv, text/markdown, text/x-python, text/xml, text/rtf, video/text/timestamp - Applications: application/x-javascript, application/x-typescript, application/x-python-code, application/json, application/x-ipynb+json, application/rtf, application/pdf For additional context, see [Supported file formats](https://ai.google.dev/gemini-api/docs/file-input-methods#supported-content-types). //", + "description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).", "type": "string" }, "data": { + "description": "Raw bytes for media formats.", "format": "byte", - "type": "string", - "description": "Raw bytes for media formats." + "type": "string" } } }, - "SearchEntryPoint": { + "FileSearch": { "type": "object", - "description": "Google search entry point.", + "description": "The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.", "properties": { - "renderedContent": { - "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.", - "type": "string" - }, - "sdkBlob": { - "description": "Optional. Base64 encoded JSON representing array of tuple.", + "metadataFilter": { "type": "string", - "format": "byte" + "description": "Optional. Metadata filter to apply to the semantic retrieval documents and chunks." + }, + "topK": { + "description": "Optional. The number of semantic retrieval chunks to retrieve.", + "format": "int32", + "type": "integer" + }, + "fileSearchStoreNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`" } } }, - "LogprobsResult": { + "GoogleSearchRetrieval": { "type": "object", - "description": "Logprobs Result", + "description": "Tool to retrieve public web data for grounding, powered by Google.", "properties": { - "logProbabilitySum": { - "type": "number", - "description": "Sum of log probabilities for all tokens.", - "format": "float" + "dynamicRetrievalConfig": { + "$ref": "#/components/schemas/DynamicRetrievalConfig", + "description": "Specifies the dynamic retrieval configuration for the given source." + } + } + }, + "PromptFeedback": { + "type": "object", + "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", + "properties": { + "blockReason": { + "type": "string", + "x-enum-descriptions": [ + "Default value. This value is unused.", + "Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", + "Prompt was blocked due to unknown reasons.", + "Prompt was blocked due to the terms which are included from the terminology blocklist.", + "Prompt was blocked due to prohibited content.", + "Candidates blocked due to unsafe image generation content." + ], + "enum": [ + "BLOCK_REASON_UNSPECIFIED", + "SAFETY", + "OTHER", + "BLOCKLIST", + "PROHIBITED_CONTENT", + "IMAGE_SAFETY" + ], + "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt." }, - "topCandidates": { + "safetyRatings": { + "description": "Ratings for safety of the prompt. There is at most one rating per category.", "items": { - "$ref": "#/components/schemas/TopCandidates" + "$ref": "#/components/schemas/SafetyRating" }, - "description": "Length = total number of decoding steps.", "type": "array" - }, - "chosenCandidates": { - "items": { - "$ref": "#/components/schemas/LogprobsResultCandidate" - }, - "type": "array", - "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates." } } }, - "ImageConfig": { - "description": "Config for image generation features.", + "Dataset": { + "description": "Dataset for training or validation.", "properties": { - "aspectRatio": { - "description": "Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, or `21:9`. If not specified, the model will choose a default aspect ratio based on any reference images provided.", - "type": "string" - }, - "imageSize": { - "type": "string", - "description": "Optional. Specifies the size of generated images. Supported values are `512`, `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`." + "examples": { + "description": "Optional. Inline examples with simple input/output text.", + "$ref": "#/components/schemas/TuningExamples" } }, "type": "object" }, - "GoogleAiGenerativelanguageV1betaSegment": { + "WebSearch": { "type": "object", - "description": "Segment of the content.", + "description": "Standard web search for grounding and related configurations.", + "properties": {} + }, + "Document": { + "description": "A `Document` is a collection of `Chunk`s.", "properties": { - "text": { - "description": "The text corresponding to the segment from the response.", + "displayName": { + "type": "string", + "description": "Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: \"Semantic Retriever Documentation\"" + }, + "updateTime": { + "description": "Output only. The Timestamp of when the `Document` was last updated.", + "format": "google-datetime", + "readOnly": true, "type": "string" }, - "endIndex": { - "format": "int32", - "description": "End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.", - "type": "integer" + "createTime": { + "description": "Output only. The Timestamp of when the `Document` was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" }, - "startIndex": { - "type": "integer", - "description": "Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.", - "format": "int32" + "state": { + "description": "Output only. Current state of the `Document`.", + "readOnly": true, + "type": "string", + "x-enum-descriptions": [ + "The default value. This value is used if the state is omitted.", + "Some `Chunks` of the `Document` are being processed (embedding and vector storage).", + "All `Chunks` of the `Document` is processed and available for querying.", + "Some `Chunks` of the `Document` failed processing." + ], + "enum": [ + "STATE_UNSPECIFIED", + "STATE_PENDING", + "STATE_ACTIVE", + "STATE_FAILED" + ] }, - "partIndex": { - "description": "The index of a Part object within its parent Content object.", - "type": "integer", - "format": "int32" - } - } - }, - "CustomMetadata": { - "description": "User provided metadata stored as key-value pairs.", - "properties": { - "stringValue": { + "sizeBytes": { + "readOnly": true, + "description": "Output only. The size of raw bytes ingested into the Document.", + "format": "int64", + "type": "string" + }, + "name": { "type": "string", - "description": "The string value of the metadata to store." + "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"fileSearchStores/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`" }, - "stringListValue": { - "$ref": "#/components/schemas/StringList", - "description": "The StringList value of the metadata to store." + "customMetadata": { + "items": { + "$ref": "#/components/schemas/CustomMetadata" + }, + "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.", + "type": "array" }, - "key": { - "description": "Required. The key of the metadata to store.", + "mimeType": { + "description": "Output only. The mime type of the Document.", + "readOnly": true, "type": "string" - }, - "numericValue": { - "description": "The numeric value of the metadata to store.", - "type": "number", - "format": "float" } }, "type": "object" }, - "ListFilesResponse": { + "GroundingAttribution": { "type": "object", - "description": "Response for `ListFiles`.", + "description": "Attribution for a source that contributed to an answer.", "properties": { - "files": { - "description": "The list of `File`s.", - "type": "array", - "items": { - "$ref": "#/components/schemas/File" - } + "sourceId": { + "description": "Output only. Identifier for the source contributing to this attribution.", + "readOnly": true, + "$ref": "#/components/schemas/AttributionSourceId" }, - "nextPageToken": { - "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.", - "type": "string" + "content": { + "$ref": "#/components/schemas/Content", + "description": "Grounding source content that makes up this attribution." } } }, - "ListFileSearchStoresResponse": { - "description": "Response from `ListFileSearchStores` containing a paginated list of `FileSearchStores`. The results are sorted by ascending `file_search_store.create_time`.", + "CustomLongRunningOperation": { "properties": { - "fileSearchStores": { - "description": "The returned rag_stores.", - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSearchStore" + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "#/components/schemas/Status" + }, + "response": { + "type": "object", + "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." } }, - "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", - "type": "string" + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available." + }, + "metadata": { + "type": "object", + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } } }, "type": "object" }, - "File": { - "description": "A file uploaded to the API. Next ID: 15", + "FunctionDeclaration": { + "type": "object", + "description": "Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.", "properties": { - "videoMetadata": { - "readOnly": true, - "$ref": "#/components/schemas/VideoFileMetadata", - "description": "Output only. Metadata for a video." - }, - "updateTime": { - "format": "google-datetime", - "readOnly": true, - "type": "string", - "description": "Output only. The timestamp of when the `File` was last updated." - }, "name": { - "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`", - "type": "string" - }, - "sizeBytes": { - "readOnly": true, - "type": "string", - "description": "Output only. Size of the file in bytes.", - "format": "int64" - }, - "sha256Hash": { - "description": "Output only. SHA-256 hash of the uploaded bytes.", - "readOnly": true, "type": "string", - "format": "byte" - }, - "downloadUri": { - "description": "Output only. The download uri of the `File`.", - "readOnly": true, - "type": "string" + "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128." }, - "mimeType": { - "readOnly": true, - "type": "string", - "description": "Output only. MIME type of the file." + "response": { + "$ref": "#/components/schemas/Schema", + "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function." }, - "source": { + "behavior": { + "description": "Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.", "type": "string", - "enum": [ - "SOURCE_UNSPECIFIED", - "UPLOADED", - "GENERATED", - "REGISTERED" - ], - "description": "Source of the File.", "x-enum-descriptions": [ - "Used if source is not specified.", - "Indicates the file is uploaded by the user.", - "Indicates the file is generated by Google.", - "Indicates the file is a registered, i.e. a Google Cloud Storage file." + "This value is unused.", + "If set, the system will wait to receive the function response before continuing the conversation.", + "If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model." + ], + "enum": [ + "UNSPECIFIED", + "BLOCKING", + "NON_BLOCKING" ] }, - "state": { - "description": "Output only. Processing state of the File.", - "readOnly": true, + "description": { "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "PROCESSING", - "ACTIVE", - "FAILED" - ], - "x-enum-descriptions": [ - "The default value. This value is used if the state is omitted.", - "File is being processed and cannot be used for inference yet.", - "File is processed and available for inference.", - "File failed processing." - ] + "description": "Required. A brief description of the function." }, - "displayName": { - "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"", - "type": "string" + "parametersJsonSchema": { + "description": "Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" }, \"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\", \"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive with `parameters`." }, - "error": { - "description": "Output only. Error status if File processing failed.", - "readOnly": true, - "$ref": "#/components/schemas/Status" + "parameters": { + "description": "Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.", + "$ref": "#/components/schemas/Schema" }, - "uri": { - "description": "Output only. The uri of the `File`.", - "readOnly": true, - "type": "string" + "responseJsonSchema": { + "description": "Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`." + } + } + }, + "ExecutableCode": { + "description": "Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.", + "properties": { + "id": { + "type": "string", + "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`." }, - "expirationTime": { - "format": "google-datetime", - "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.", - "readOnly": true, + "code": { + "description": "Required. The code to be executed.", "type": "string" }, - "createTime": { - "description": "Output only. The timestamp of when the `File` was created.", - "readOnly": true, + "language": { + "description": "Required. Programming language of the `code`.", "type": "string", - "format": "google-datetime" + "x-enum-descriptions": [ + "Unspecified language. This value should not be used.", + "Python >= 3.10, with numpy and simpy available. Python is the default language." + ], + "enum": [ + "LANGUAGE_UNSPECIFIED", + "PYTHON" + ] } }, "type": "object" }, - "GenerateContentBatchOutput": { - "description": "The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.", + "UsageMetadata": { + "description": "Metadata on the generation request's token usage.", "properties": { - "inlinedResponses": { - "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", + "cachedContentTokenCount": { + "description": "Number of tokens in the cached part of the prompt (the cached content)", + "format": "int32", + "type": "integer" + }, + "thoughtsTokenCount": { "readOnly": true, - "$ref": "#/components/schemas/InlinedResponses" + "description": "Output only. Number of tokens of thoughts for thinking models.", + "format": "int32", + "type": "integer" }, - "responsesFile": { - "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", + "promptTokenCount": { + "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.", + "format": "int32", + "type": "integer" + }, + "cacheTokensDetails": { + "description": "Output only. List of modalities of the cached content in the request input.", "readOnly": true, - "type": "string" - } - }, - "type": "object" - }, - "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", - "properties": { - "details": { "items": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - }, - "type": "object" + "$ref": "#/components/schemas/ModalityTokenCount" }, - "type": "array", - "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use." + "type": "array" }, - "message": { - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", - "type": "string" + "toolUsePromptTokensDetails": { + "readOnly": true, + "items": { + "$ref": "#/components/schemas/ModalityTokenCount" + }, + "description": "Output only. List of modalities that were processed for tool-use request inputs.", + "type": "array" }, - "code": { + "toolUsePromptTokenCount": { + "type": "integer", + "readOnly": true, + "description": "Output only. Number of tokens present in tool-use prompt(s).", + "format": "int32" + }, + "totalTokenCount": { + "description": "Total token count for the generation request (prompt + thoughts + response candidates).", "format": "int32", - "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" - } - }, - "type": "object" - }, - "GroundingAttribution": { - "description": "Attribution for a source that contributed to an answer.", - "properties": { - "sourceId": { + }, + "promptTokensDetails": { + "type": "array", + "description": "Output only. List of modalities that were processed in the request input.", "readOnly": true, - "$ref": "#/components/schemas/AttributionSourceId", - "description": "Output only. Identifier for the source contributing to this attribution." + "items": { + "$ref": "#/components/schemas/ModalityTokenCount" + } }, - "content": { - "$ref": "#/components/schemas/Content", - "description": "Grounding source content that makes up this attribution." + "candidatesTokensDetails": { + "readOnly": true, + "items": { + "$ref": "#/components/schemas/ModalityTokenCount" + }, + "description": "Output only. List of modalities that were returned in the response.", + "type": "array" + }, + "candidatesTokenCount": { + "type": "integer", + "description": "Total number of tokens across all the generated response candidates.", + "format": "int32" + }, + "responseTokenCount": { + "description": "Output only. Number of tokens in the response. Used by Gemini 3.1+ Live API models instead of candidatesTokenCount.", + "type": "integer", + "format": "int32", + "readOnly": true + }, + "responseTokensDetails": { + "description": "Output only. List of modalities returned in the response with per-modality token counts. Used by Gemini 3.1+ Live API models instead of candidatesTokensDetails.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/components/schemas/ModalityTokenCount" + } } }, "type": "object" }, - "FunctionResponsePart": { + "TuningExample": { "type": "object", - "description": "A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", + "description": "A single example for tuning.", "properties": { - "inlineData": { - "description": "Inline media bytes.", - "$ref": "#/components/schemas/FunctionResponseBlob" + "textInput": { + "type": "string", + "description": "Optional. Text model input." + }, + "output": { + "description": "Required. The expected model output.", + "type": "string" } } }, - "ComputerUse": { - "description": "Computer Use tool type.", + "ListTunedModelsResponse": { + "description": "Response from `ListTunedModels` containing a paginated list of Models.", "properties": { - "environment": { - "type": "string", - "enum": [ - "ENVIRONMENT_UNSPECIFIED", - "ENVIRONMENT_BROWSER" - ], - "description": "Required. The environment being operated.", - "x-enum-descriptions": [ - "Defaults to browser.", - "Operates in a web browser." - ] - }, - "excludedPredefinedFunctions": { + "tunedModels": { "items": { - "type": "string" + "$ref": "#/components/schemas/TunedModel" }, - "description": "Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.", + "description": "The returned Models.", "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "type": "string" } }, "type": "object" }, - "InlinedResponse": { - "type": "object", - "description": "The response to a single request in the batch.", + "FileSearchStore": { + "description": "A `FileSearchStore` is a collection of `Document`s.", "properties": { - "metadata": { - "description": "Output only. The metadata associated with the request.", - "additionalProperties": { - "description": "Properties of the object." - }, + "createTime": { + "type": "string", + "description": "Output only. The Timestamp of when the `FileSearchStore` was created.", + "format": "google-datetime", + "readOnly": true + }, + "updateTime": { "readOnly": true, - "type": "object" + "description": "Output only. The Timestamp of when the `FileSearchStore` was last updated.", + "format": "google-datetime", + "type": "string" }, - "error": { - "description": "Output only. The error encountered while processing the request.", + "sizeBytes": { "readOnly": true, - "$ref": "#/components/schemas/Status" + "description": "Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`.", + "format": "int64", + "type": "string" }, - "response": { - "description": "Output only. The response to the request.", + "failedDocumentsCount": { + "type": "string", "readOnly": true, - "$ref": "#/components/schemas/GenerateContentResponse" - } - } - }, - "FileSearch": { - "description": "The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.", - "properties": { - "topK": { - "format": "int32", - "description": "Optional. The number of semantic retrieval chunks to retrieve.", - "type": "integer" + "description": "Output only. The number of documents in the `FileSearchStore` that have failed processing.", + "format": "int64" }, - "fileSearchStoreNames": { - "items": { - "type": "string" - }, - "description": "Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`", - "type": "array" + "displayName": { + "description": "Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", + "type": "string" }, - "metadataFilter": { - "description": "Optional. Metadata filter to apply to the semantic retrieval documents and chunks.", + "embeddingModel": { + "type": "string", + "description": "Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used." + }, + "name": { + "description": "Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the \"fileSearchStores/\" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.", + "readOnly": true, "type": "string" - } - }, - "type": "object" - }, - "InputConfig": { - "type": "object", - "description": "Configures the input to the batch request.", - "properties": { - "fileName": { + }, + "activeDocumentsCount": { "type": "string", - "description": "The name of the `File` containing the input requests." + "readOnly": true, + "description": "Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval.", + "format": "int64" }, - "requests": { - "description": "The requests to be processed in the batch.", - "$ref": "#/components/schemas/InlinedRequests" + "pendingDocumentsCount": { + "type": "string", + "readOnly": true, + "description": "Output only. The number of documents in the `FileSearchStore` that are being processed.", + "format": "int64" } - } + }, + "type": "object" }, "Operation": { - "type": "object", "description": "This resource represents a long-running operation that is the result of a network API call.", "properties": { - "done": { - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", - "type": "boolean" - }, "name": { "type": "string", "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`." }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "#/components/schemas/Status" + }, "response": { - "type": "object", - "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL." - } + }, + "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "type": "object" + }, + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available." }, "metadata": { - "type": "object", - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL." - } - }, - "error": { - "description": "The error result of the operation in case of failure or cancellation.", - "$ref": "#/components/schemas/Status" + }, + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object" } - } + }, + "type": "object" }, - "UrlContextMetadata": { - "description": "Metadata related to url context retrieval tool.", + "FunctionCall": { + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", "properties": { - "urlMetadata": { - "items": { - "$ref": "#/components/schemas/UrlMetadata" + "name": { + "type": "string", + "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128." + }, + "args": { + "additionalProperties": { + "description": "Properties of the object." }, - "description": "List of url context.", - "type": "array" + "description": "Optional. The function parameters and values in JSON object format.", + "type": "object" + }, + "id": { + "description": "Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.", + "type": "string" } }, "type": "object" }, - "ListCachedContentsResponse": { - "description": "Response with CachedContents list.", + "TransferOwnershipResponse": { + "type": "object", + "description": "Response from `TransferOwnership`.", + "properties": {} + }, + "Permission": { + "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete", "properties": { - "cachedContents": { - "description": "List of cached contents.", - "type": "array", - "items": { - "$ref": "#/components/schemas/CachedContent" - } + "name": { + "readOnly": true, + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "type": "string" }, - "nextPageToken": { + "granteeType": { + "type": "string", + "x-enum-descriptions": [ + "The default value. This value is unused.", + "Represents a user. When set, you must provide email_address for the user.", + "Represents a group. When set, you must provide email_address for the group.", + "Represents access to everyone. No extra information is required." + ], + "enum": [ + "GRANTEE_TYPE_UNSPECIFIED", + "USER", + "GROUP", + "EVERYONE" + ], + "description": "Optional. Immutable. The type of the grantee." + }, + "emailAddress": { "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages." + "description": "Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE." + }, + "role": { + "type": "string", + "x-enum-descriptions": [ + "The default value. This value is unused.", + "Owner can use, update, share and delete the resource.", + "Writer can use, update and share the resource.", + "Reader can use the resource." + ], + "enum": [ + "ROLE_UNSPECIFIED", + "OWNER", + "WRITER", + "READER" + ], + "description": "Required. The role granted by this permission." } }, "type": "object" }, - "Hyperparameters": { + "SafetyRating": { "type": "object", - "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", + "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.", "properties": { - "epochCount": { - "type": "integer", - "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used.", - "format": "int32" - }, - "learningRate": { - "format": "float", - "type": "number", - "description": "Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples." + "probability": { + "type": "string", + "x-enum-descriptions": [ + "Probability is unspecified.", + "Content has a negligible chance of being unsafe.", + "Content has a low chance of being unsafe.", + "Content has a medium chance of being unsafe.", + "Content has a high chance of being unsafe." + ], + "enum": [ + "HARM_PROBABILITY_UNSPECIFIED", + "NEGLIGIBLE", + "LOW", + "MEDIUM", + "HIGH" + ], + "description": "Required. The probability of harm for this content." }, - "learningRateMultiplier": { - "format": "float", - "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.", - "type": "number" + "blocked": { + "description": "Was this content blocked because of this rating?", + "type": "boolean" }, - "batchSize": { - "format": "int32", - "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.", - "type": "integer" + "category": { + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true + ], + "x-enum-descriptions": [ + "Category is unspecified.", + "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", + "**PaLM** - Content that is rude, disrespectful, or profane.", + "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", + "**PaLM** - Contains references to sexual acts or other lewd content.", + "**PaLM** - Promotes unchecked medical advice.", + "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", + "**Gemini** - Harassment content.", + "**Gemini** - Hate speech and content.", + "**Gemini** - Sexually explicit content.", + "**Gemini** - Dangerous content.", + "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." + ], + "enum": [ + "HARM_CATEGORY_UNSPECIFIED", + "HARM_CATEGORY_DEROGATORY", + "HARM_CATEGORY_TOXICITY", + "HARM_CATEGORY_VIOLENCE", + "HARM_CATEGORY_SEXUAL", + "HARM_CATEGORY_MEDICAL", + "HARM_CATEGORY_DANGEROUS", + "HARM_CATEGORY_HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH", + "HARM_CATEGORY_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_DANGEROUS_CONTENT", + "HARM_CATEGORY_CIVIC_INTEGRITY" + ], + "description": "Required. The category for this rating.", + "type": "string" } } }, - "GroundingChunk": { - "description": "A `GroundingChunk` represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps.", + "BatchStats": { + "description": "Stats about the batch.", "properties": { - "web": { - "description": "Grounding chunk from the web.", - "$ref": "#/components/schemas/Web" + "requestCount": { + "type": "string", + "description": "Output only. The number of requests in the batch.", + "format": "int64", + "readOnly": true }, - "retrievedContext": { - "description": "Optional. Grounding chunk from context retrieved by the file search tool.", - "$ref": "#/components/schemas/RetrievedContext" + "failedRequestCount": { + "readOnly": true, + "description": "Output only. The number of requests that failed to be processed.", + "format": "int64", + "type": "string" }, - "image": { - "description": "Optional. Grounding chunk from image search.", - "$ref": "#/components/schemas/Image" + "pendingRequestCount": { + "description": "Output only. The number of requests that are still pending processing.", + "format": "int64", + "readOnly": true, + "type": "string" }, - "maps": { - "$ref": "#/components/schemas/Maps", - "description": "Optional. Grounding chunk from Google Maps." + "successfulRequestCount": { + "description": "Output only. The number of requests that were successfully processed.", + "format": "int64", + "readOnly": true, + "type": "string" } }, "type": "object" }, - "CachedContentUsageMetadata": { - "type": "object", - "description": "Metadata on the usage of the cached content.", - "properties": { - "totalTokenCount": { - "format": "int32", - "description": "Total number of tokens that the cached content consumes.", - "type": "integer" - } - } - }, - "TuningExample": { + "SafetySetting": { "type": "object", - "description": "A single example for tuning.", + "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.", "properties": { - "textInput": { - "description": "Optional. Text model input.", + "category": { + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true + ], + "x-enum-descriptions": [ + "Category is unspecified.", + "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", + "**PaLM** - Content that is rude, disrespectful, or profane.", + "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", + "**PaLM** - Contains references to sexual acts or other lewd content.", + "**PaLM** - Promotes unchecked medical advice.", + "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", + "**Gemini** - Harassment content.", + "**Gemini** - Hate speech and content.", + "**Gemini** - Sexually explicit content.", + "**Gemini** - Dangerous content.", + "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." + ], + "enum": [ + "HARM_CATEGORY_UNSPECIFIED", + "HARM_CATEGORY_DEROGATORY", + "HARM_CATEGORY_TOXICITY", + "HARM_CATEGORY_VIOLENCE", + "HARM_CATEGORY_SEXUAL", + "HARM_CATEGORY_MEDICAL", + "HARM_CATEGORY_DANGEROUS", + "HARM_CATEGORY_HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH", + "HARM_CATEGORY_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_DANGEROUS_CONTENT", + "HARM_CATEGORY_CIVIC_INTEGRITY" + ], + "description": "Required. The category for this setting.", "type": "string" }, - "output": { + "threshold": { + "description": "Required. Controls the probability threshold at which harm is blocked.", "type": "string", - "description": "Required. The expected model output." + "x-enum-descriptions": [ + "Threshold is unspecified.", + "Content with NEGLIGIBLE will be allowed.", + "Content with NEGLIGIBLE and LOW will be allowed.", + "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.", + "All content will be allowed.", + "Turn off the safety filter." + ], + "enum": [ + "HARM_BLOCK_THRESHOLD_UNSPECIFIED", + "BLOCK_LOW_AND_ABOVE", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_ONLY_HIGH", + "BLOCK_NONE", + "OFF" + ] } } }, @@ -4733,551 +4546,675 @@ "description": "The GoogleMaps Tool that provides geospatial context for the user's query.", "properties": { "enableWidget": { - "description": "Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.", - "type": "boolean" + "type": "boolean", + "description": "Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response." } } }, - "UrlMetadata": { - "type": "object", - "description": "Context of the a single url retrieval.", + "Schema": { + "description": "The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).", "properties": { - "retrievedUrl": { - "type": "string", - "description": "Retrieved url by the tool." + "nullable": { + "type": "boolean", + "description": "Optional. Indicates if the value may be null." }, - "urlRetrievalStatus": { - "type": "string", - "enum": [ - "URL_RETRIEVAL_STATUS_UNSPECIFIED", - "URL_RETRIEVAL_STATUS_SUCCESS", - "URL_RETRIEVAL_STATUS_ERROR", - "URL_RETRIEVAL_STATUS_PAYWALL", - "URL_RETRIEVAL_STATUS_UNSAFE" - ], - "description": "Status of the url retrieval.", - "x-enum-descriptions": [ - "Default value. This value is unused.", - "Url retrieval is successful.", - "Url retrieval is failed due to error.", - "Url retrieval is failed because the content is behind paywall.", - "Url retrieval is failed because the content is unsafe." - ] - } - } - }, - "Content": { - "type": "object", - "description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.", - "properties": { - "parts": { + "propertyOrdering": { "items": { - "$ref": "#/components/schemas/Part" + "type": "string" }, - "type": "array", - "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types." + "description": "Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.", + "type": "array" }, - "role": { - "type": "string", - "description": "Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset." - } - } - }, - "FunctionResponse": { - "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.", - "properties": { - "willContinue": { - "type": "boolean", - "description": "Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`." + "maxItems": { + "description": "Optional. Maximum number of the elements for Type.ARRAY.", + "format": "int64", + "type": "string" }, - "parts": { - "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.", + "required": { "type": "array", + "description": "Optional. Required properties of Type.OBJECT.", "items": { - "$ref": "#/components/schemas/FunctionResponsePart" + "type": "string" } }, - "scheduling": { - "type": "string", - "enum": [ - "SCHEDULING_UNSPECIFIED", - "SILENT", - "WHEN_IDLE", - "INTERRUPT" - ], - "description": "Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.", - "x-enum-descriptions": [ - "This value is unused.", - "Only add the result to the conversation context, do not interrupt or trigger generation.", - "Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.", - "Add the result to the conversation context, interrupt ongoing generation and prompt to generate output." - ] + "example": { + "description": "Optional. Example of the object. Will only populated when the object is the root." }, - "id": { - "description": "Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.", - "type": "string" + "default": { + "description": "Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors." }, - "response": { - "description": "Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. \"output\", \"result\", etc. In particular, if the function call failed to execute, the response can have an \"error\" key to return error details to the model.", + "properties": { + "type": "object", "additionalProperties": { - "description": "Properties of the object." + "$ref": "#/components/schemas/Schema" }, - "type": "object" - }, - "name": { - "type": "string", - "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128." - } - }, - "type": "object" - }, - "Image": { - "type": "object", - "description": "Chunk from image search.", - "properties": { - "title": { - "type": "string", - "description": "The title of the web page that the image is from." + "description": "Optional. Properties of Type.OBJECT." }, - "domain": { - "type": "string", - "description": "The root domain of the web page that the image is from, e.g. \"example.com\"." + "items": { + "description": "Optional. Schema of the elements of Type.ARRAY.", + "$ref": "#/components/schemas/Schema" }, - "sourceUri": { - "description": "The web page URI for attribution.", + "minProperties": { + "description": "Optional. Minimum number of the properties for Type.OBJECT.", + "format": "int64", "type": "string" }, - "imageUri": { - "description": "The image asset URL.", + "minLength": { + "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING", + "format": "int64", "type": "string" - } - } - }, - "Model": { - "type": "object", - "description": "Information about a Generative Language Model.", - "properties": { - "outputTokenLimit": { - "description": "Maximum number of output tokens available for this model.", - "type": "integer", - "format": "int32" - }, - "version": { - "type": "string", - "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)" - }, - "supportedGenerationMethods": { - "type": "array", - "description": "The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.", - "items": { - "type": "string" - } - }, - "maxTemperature": { - "description": "The maximum temperature this model can use.", - "type": "number", - "format": "float" }, - "description": { + "type": { "type": "string", - "description": "A short description of the model." - }, - "inputTokenLimit": { - "format": "int32", - "type": "integer", - "description": "Maximum number of input tokens allowed for this model." - }, - "temperature": { - "format": "float", - "description": "Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.", - "type": "number" + "x-enum-descriptions": [ + "Not specified, should not be used.", + "String type.", + "Number type.", + "Integer type.", + "Boolean type.", + "Array type.", + "Object type.", + "Null type." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "STRING", + "NUMBER", + "INTEGER", + "BOOLEAN", + "ARRAY", + "OBJECT", + "NULL" + ], + "description": "Required. Data type." }, - "topP": { - "format": "float", - "description": "For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.", - "type": "number" + "title": { + "description": "Optional. The title of the schema.", + "type": "string" }, - "topK": { - "format": "int32", - "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.", - "type": "integer" + "minItems": { + "description": "Optional. Minimum number of the elements for Type.ARRAY.", + "format": "int64", + "type": "string" }, - "baseModelId": { - "type": "string", - "description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`" + "minimum": { + "type": "number", + "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER", + "format": "double" }, - "displayName": { + "format": { "type": "string", - "description": "The human-readable name of the model. E.g. \"Gemini 1.5 Flash\". The name can be up to 128 characters long and can consist of any UTF-8 characters." - }, - "thinking": { - "description": "Whether the model supports thinking.", - "type": "boolean" + "description": "Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality." }, - "name": { - "type": "string", - "description": "Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/gemini-1.5-flash-001`" - } - } - }, - "StreamableHttpTransport": { - "description": "A transport that can stream HTTP requests and responses. Next ID: 6", - "properties": { - "headers": { - "description": "Optional: Fields for authentication headers, timeouts, etc., if needed.", - "additionalProperties": { - "type": "string" - }, - "type": "object" + "description": { + "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.", + "type": "string" }, - "sseReadTimeout": { - "type": "string", - "description": "Timeout for SSE read operations.", - "format": "google-duration" + "maxProperties": { + "description": "Optional. Maximum number of the properties for Type.OBJECT.", + "format": "int64", + "type": "string" }, - "terminateOnClose": { - "description": "Whether to close the client session when the transport closes.", - "type": "boolean" + "maximum": { + "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER", + "format": "double", + "type": "number" }, - "timeout": { - "format": "google-duration", - "description": "HTTP timeout for regular operations.", + "maxLength": { + "description": "Optional. Maximum length of the Type.STRING", + "format": "int64", "type": "string" }, - "url": { - "description": "The full URL for the MCPServer endpoint. Example: \"https://api.example.com/mcp\"", + "anyOf": { + "items": { + "$ref": "#/components/schemas/Schema" + }, + "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.", + "type": "array" + }, + "pattern": { + "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.", "type": "string" + }, + "enum": { + "type": "array", + "description": "Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]}", + "items": { + "type": "string" + } } }, "type": "object" }, - "RetrievalMetadata": { + "RegisterFilesResponse": { "type": "object", - "description": "Metadata related to retrieval in the grounding flow.", + "description": "Response for `RegisterFiles`.", "properties": { - "googleSearchDynamicRetrievalScore": { - "format": "float", - "description": "Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search.", - "type": "number" + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/File" + }, + "description": "The registered files to be used when calling GenerateContent." } } }, - "LatLng": { - "description": "An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.", + "ComputerUse": { + "description": "Computer Use tool type.", "properties": { - "latitude": { - "type": "number", - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", - "format": "double" + "environment": { + "description": "Required. The environment being operated.", + "type": "string", + "x-enum-descriptions": [ + "Defaults to browser.", + "Operates in a web browser." + ], + "enum": [ + "ENVIRONMENT_UNSPECIFIED", + "ENVIRONMENT_BROWSER" + ] }, - "longitude": { - "type": "number", - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", - "format": "double" + "excludedPredefinedFunctions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions." } }, "type": "object" }, - "CachedContent": { - "type": "object", - "description": "Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for.", + "Corpus": { + "description": "A `Corpus` is a collection of `Document`s. A project can create up to 10 corpora.", "properties": { - "expireTime": { - "format": "google-datetime", - "type": "string", - "description": "Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input." - }, "name": { "readOnly": true, - "type": "string", - "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`" - }, - "updateTime": { - "format": "google-datetime", - "readOnly": true, - "type": "string", - "description": "Output only. When the cache entry was last updated in UTC time." - }, - "model": { - "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`", + "description": "Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`", "type": "string" }, "createTime": { - "readOnly": true, "type": "string", - "description": "Output only. Creation time of the cache entry.", + "readOnly": true, + "description": "Output only. The Timestamp of when the `Corpus` was created.", "format": "google-datetime" }, - "contents": { - "items": { - "$ref": "#/components/schemas/Content" - }, - "type": "array", - "description": "Optional. Input only. Immutable. The content to cache." - }, - "toolConfig": { - "$ref": "#/components/schemas/ToolConfig", - "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools." - }, - "ttl": { - "format": "google-duration", - "type": "string", - "description": "Input only. New TTL for this resource, input only." + "updateTime": { + "readOnly": true, + "description": "Output only. The Timestamp of when the `Corpus` was last updated.", + "format": "google-datetime", + "type": "string" }, "displayName": { - "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.", + "description": "Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", "type": "string" - }, - "systemInstruction": { - "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only.", - "$ref": "#/components/schemas/Content" - }, - "usageMetadata": { - "description": "Output only. Metadata on the usage of the cached content.", - "readOnly": true, - "$ref": "#/components/schemas/CachedContentUsageMetadata" - }, - "tools": { + } + }, + "type": "object" + }, + "GroundingChunkStringList": { + "description": "A list of string values.", + "properties": { + "values": { + "type": "array", "items": { - "$ref": "#/components/schemas/Tool" + "type": "string" }, - "type": "array", - "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response" + "description": "The string values of the list." + } + }, + "type": "object" + }, + "CachedContentUsageMetadata": { + "type": "object", + "description": "Metadata on the usage of the cached content.", + "properties": { + "totalTokenCount": { + "description": "Total number of tokens that the cached content consumes.", + "format": "int32", + "type": "integer" } } }, - "ToolCall": { + "InputConfig": { "type": "object", - "description": "A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.", + "description": "Configures the input to the batch request.", "properties": { - "args": { - "description": "Optional. The tool call arguments. Example: {\"arg1\" : \"value1\", \"arg2\" : \"value2\" , ...}", - "additionalProperties": { - "description": "Properties of the object." - }, - "type": "object" - }, - "toolType": { + "fileName": { "type": "string", - "enum": [ - "TOOL_TYPE_UNSPECIFIED", - "GOOGLE_SEARCH_WEB", - "GOOGLE_SEARCH_IMAGE", - "URL_CONTEXT", - "GOOGLE_MAPS", - "FILE_SEARCH" - ], - "description": "Required. The type of tool that was called.", - "x-enum-descriptions": [ - "Unspecified tool type.", - "Google search tool, maps to Tool.google_search.search_types.web_search.", - "Image search tool, maps to Tool.google_search.search_types.image_search.", - "URL context tool, maps to Tool.url_context.", - "Google maps tool, maps to Tool.google_maps.", - "File search tool, maps to Tool.file_search." - ] + "description": "The name of the `File` containing the input requests." }, - "id": { - "description": "Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.", - "type": "string" + "requests": { + "description": "The requests to be processed in the batch.", + "$ref": "#/components/schemas/InlinedRequests" } } }, - "Interval": { - "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "AttributionSourceId": { + "description": "Identifier for the source contributing to this attribution.", "properties": { - "endTime": { - "format": "google-datetime", + "semanticRetrieverChunk": { + "description": "Identifier for a `Chunk` fetched via Semantic Retriever.", + "$ref": "#/components/schemas/SemanticRetrieverChunk" + }, + "groundingPassage": { + "$ref": "#/components/schemas/GroundingPassageId", + "description": "Identifier for an inline passage." + } + }, + "type": "object" + }, + "SearchTypes": { + "type": "object", + "description": "Different types of search that can be enabled on the GoogleSearch tool.", + "properties": { + "webSearch": { + "$ref": "#/components/schemas/WebSearch", + "description": "Optional. Enables web search. Only text results are returned." + }, + "imageSearch": { + "$ref": "#/components/schemas/ImageSearch", + "description": "Optional. Enables image search. Image bytes are returned." + } + } + }, + "RetrievedContext": { + "description": "Chunk from context retrieved by the file search tool.", + "properties": { + "uri": { "type": "string", - "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end." + "description": "Optional. URI reference of the semantic retrieval document." }, - "startTime": { - "format": "google-datetime", + "text": { + "type": "string", + "description": "Optional. Text of the chunk." + }, + "mediaId": { + "type": "string", + "description": "Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}" + }, + "title": { "type": "string", - "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start." + "description": "Optional. Title of the document." + }, + "customMetadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroundingChunkCustomMetadata" + }, + "description": "Optional. User-provided metadata about the retrieved context." + }, + "pageNumber": { + "description": "Optional. Page number of the retrieved context, if applicable.", + "format": "int32", + "type": "integer" + }, + "fileSearchStore": { + "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`", + "type": "string" } }, "type": "object" }, - "McpServer": { - "description": "A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6", - "properties": { - "streamableHttpTransport": { - "description": "A transport that can stream HTTP requests and responses.", - "$ref": "#/components/schemas/StreamableHttpTransport" + "VideoMetadata": { + "type": "object", + "description": "Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content.", + "deprecated": true, + "properties": { + "startOffset": { + "description": "Optional. The start offset of the video.", + "format": "google-duration", + "type": "string" }, - "name": { + "fps": { + "type": "number", + "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].", + "format": "double" + }, + "endOffset": { "type": "string", - "description": "The name of the MCPServer." + "description": "Optional. The end offset of the video.", + "format": "google-duration" } - }, - "type": "object" + } }, "ListModelsResponse": { + "type": "object", "description": "Response from `ListModel` containing a paginated list of Models.", "properties": { "models": { - "description": "The returned Models.", "type": "array", "items": { "$ref": "#/components/schemas/Model" - } + }, + "description": "The returned Models." }, "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "type": "string" } - }, - "type": "object" + } }, - "TuningSnapshot": { + "CountTokensResponse": { "type": "object", - "description": "Record for a single tuning step.", + "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.", "properties": { - "meanLoss": { - "format": "float", - "description": "Output only. The mean loss of the training examples for this step.", + "promptTokensDetails": { + "type": "array", + "description": "Output only. List of modalities that were processed in the request input.", "readOnly": true, - "type": "number" + "items": { + "$ref": "#/components/schemas/ModalityTokenCount" + } }, - "computeTime": { - "format": "google-datetime", + "cacheTokensDetails": { "readOnly": true, - "type": "string", - "description": "Output only. The timestamp when this metric was computed." + "items": { + "$ref": "#/components/schemas/ModalityTokenCount" + }, + "description": "Output only. List of modalities that were processed in the cached content.", + "type": "array" }, - "epoch": { - "description": "Output only. The epoch this step was part of.", - "readOnly": true, + "totalTokens": { "type": "integer", + "description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative.", "format": "int32" }, - "step": { - "readOnly": true, - "type": "integer", - "description": "Output only. The tuning step.", - "format": "int32" + "cachedContentTokenCount": { + "description": "Number of tokens in the cached part of the prompt (the cached content).", + "format": "int32", + "type": "integer" } } }, - "RegisterFilesResponse": { - "type": "object", - "description": "Response for `RegisterFiles`.", + "UploadToFileSearchStoreRequest": { + "description": "Request for `UploadToFileSearchStore`.", "properties": { - "files": { + "chunkingConfig": { + "$ref": "#/components/schemas/ChunkingConfig", + "description": "Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters." + }, + "displayName": { + "description": "Optional. Display name of the created document.", + "type": "string" + }, + "customMetadata": { + "type": "array", "items": { - "$ref": "#/components/schemas/File" + "$ref": "#/components/schemas/CustomMetadata" }, - "description": "The registered files to be used when calling GenerateContent.", - "type": "array" + "description": "Custom metadata to be associated with the data." + }, + "mimeType": { + "type": "string", + "description": "Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content." } - } - }, - "CodeExecution": { - "description": "Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.", - "properties": {}, + }, "type": "object" }, - "UploadToFileSearchStoreRequest": { + "ThinkingConfig": { "type": "object", - "description": "Request for `UploadToFileSearchStore`.", + "description": "Config for thinking features.", "properties": { - "customMetadata": { + "thinkingBudget": { + "description": "The number of thoughts tokens that the model should generate.", + "format": "int32", + "type": "integer" + }, + "thinkingLevel": { + "description": "Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error.", + "type": "string", + "x-enum-descriptions": [ + "Default value.", + "Little to no thinking.", + "Low thinking level.", + "Medium thinking level.", + "High thinking level." + ], + "enum": [ + "THINKING_LEVEL_UNSPECIFIED", + "MINIMAL", + "LOW", + "MEDIUM", + "HIGH" + ] + }, + "includeThoughts": { + "type": "boolean", + "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only when available." + } + } + }, + "GenerationConfig": { + "type": "object", + "description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.", + "properties": { + "frequencyPenalty": { + "type": "number", + "description": "Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit.", + "format": "float" + }, + "topP": { + "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", + "format": "float", + "type": "number" + }, + "enableEnhancedCivicAnswers": { + "description": "Optional. Enables enhanced civic answers. It may not be available for all models.", + "type": "boolean" + }, + "imageConfig": { + "description": "Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.", + "$ref": "#/components/schemas/ImageConfig" + }, + "presencePenalty": { + "description": "Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.", + "format": "float", + "type": "number" + }, + "maxOutputTokens": { + "description": "Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.", + "format": "int32", + "type": "integer" + }, + "responseMimeType": { + "type": "string", + "description": "Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types." + }, + "seed": { + "type": "integer", + "description": "Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.", + "format": "int32" + }, + "responseSchema": { + "$ref": "#/components/schemas/Schema", + "description": "Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible `response_mime_type` must also be set. Compatible MIME types: `application/json`: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details." + }, + "logprobs": { + "description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20].", + "format": "int32", + "type": "integer" + }, + "responseJsonSchema": { + "description": "Optional. An internal detail. Use `responseJsonSchema` rather than this field." + }, + "candidateCount": { + "description": "Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)", + "format": "int32", + "type": "integer" + }, + "topK": { + "type": "integer", + "description": "Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", + "format": "int32" + }, + "stopSequences": { + "type": "array", "items": { - "$ref": "#/components/schemas/CustomMetadata" + "type": "string" }, + "description": "Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response." + }, + "responseLogprobs": { + "description": "Optional. If true, export the logprobs results in response.", + "type": "boolean" + }, + "responseModalities": { "type": "array", - "description": "Custom metadata to be associated with the data." + "items": { + "type": "string", + "x-enum-descriptions": [ + "Default value.", + "Indicates the model should return text.", + "Indicates the model should return images.", + "Indicates the model should return audio.", + "Indicates the model should return video." + ], + "enum": [ + "MODALITY_UNSPECIFIED", + "TEXT", + "IMAGE", + "AUDIO", + "VIDEO" + ] + }, + "description": "Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text." }, - "chunkingConfig": { - "description": "Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters.", - "$ref": "#/components/schemas/ChunkingConfig" + "thinkingConfig": { + "description": "Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.", + "$ref": "#/components/schemas/ThinkingConfig" }, - "displayName": { - "description": "Optional. Display name of the created document.", - "type": "string" + "mediaResolution": { + "type": "string", + "x-enum-descriptions": [ + "Media resolution has not been set.", + "Media resolution set to low (64 tokens).", + "Media resolution set to medium (256 tokens).", + "Media resolution set to high (zoomed reframing with 256 tokens)." + ], + "enum": [ + "MEDIA_RESOLUTION_UNSPECIFIED", + "MEDIA_RESOLUTION_LOW", + "MEDIA_RESOLUTION_MEDIUM", + "MEDIA_RESOLUTION_HIGH" + ], + "description": "Optional. If specified, the media resolution specified will be used." }, - "mimeType": { - "description": "Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content.", - "type": "string" + "speechConfig": { + "$ref": "#/components/schemas/SpeechConfig", + "description": "Optional. The speech generation config." + }, + "temperature": { + "type": "number", + "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0].", + "format": "float" } } }, - "CreateFileRequest": { - "description": "Request for `CreateFile`.", + "RetrievalMetadata": { + "type": "object", + "description": "Metadata related to retrieval in the grounding flow.", "properties": { - "file": { - "description": "Optional. Metadata for the file to create.", - "$ref": "#/components/schemas/File" + "googleSearchDynamicRetrievalScore": { + "description": "Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search.", + "format": "float", + "type": "number" } - }, - "type": "object" + } }, - "GoogleAiGenerativelanguageV1betaGroundingSupport": { + "Blob": { "type": "object", - "description": "Grounding support.", + "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.", "properties": { - "groundingChunkIndices": { - "type": "array", - "description": "Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order).", - "items": { - "type": "integer", - "format": "int32" - } - }, - "renderedParts": { - "readOnly": true, - "type": "array", - "description": "Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.", - "items": { - "type": "integer", - "format": "int32" - } - }, - "segment": { - "description": "Segment of the content this support belongs to.", - "$ref": "#/components/schemas/GoogleAiGenerativelanguageV1betaSegment" + "mimeType": { + "type": "string", + "description": "The IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: text/plain, text/html, text/css, text/javascript, text/x-typescript, text/csv, text/markdown, text/x-python, text/xml, text/rtf, video/text/timestamp - Applications: application/x-javascript, application/x-typescript, application/x-python-code, application/json, application/x-ipynb+json, application/rtf, application/pdf For additional context, see [Supported file formats](https://ai.google.dev/gemini-api/docs/file-input-methods#supported-content-types). //" }, - "confidenceScores": { - "type": "array", - "description": "Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.", - "items": { - "type": "number", - "format": "float" - } + "data": { + "type": "string", + "description": "Raw bytes for media formats.", + "format": "byte" } } }, "Candidate": { - "type": "object", "description": "A response candidate generated from the model.", "properties": { - "content": { + "index": { + "type": "integer", + "description": "Output only. Index of the candidate in the list of response candidates.", + "format": "int32", + "readOnly": true + }, + "tokenCount": { + "type": "integer", + "description": "Output only. Token count for this candidate.", + "format": "int32", + "readOnly": true + }, + "groundingMetadata": { + "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.", "readOnly": true, - "$ref": "#/components/schemas/Content", - "description": "Output only. Generated content returned from the model." + "$ref": "#/components/schemas/GroundingMetadata" }, - "logprobsResult": { - "description": "Output only. Log-likelihood scores for the response tokens and top tokens", + "finishMessage": { + "type": "string", + "description": "Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.", + "readOnly": true + }, + "urlContextMetadata": { "readOnly": true, - "$ref": "#/components/schemas/LogprobsResult" + "$ref": "#/components/schemas/UrlContextMetadata", + "description": "Output only. Metadata related to url context retrieval tool." }, - "tokenCount": { - "description": "Output only. Token count for this candidate.", + "safetyRatings": { + "type": "array", + "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", + "items": { + "$ref": "#/components/schemas/SafetyRating" + } + }, + "groundingAttributions": { + "type": "array", + "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", "readOnly": true, - "type": "integer", - "format": "int32" + "items": { + "$ref": "#/components/schemas/GroundingAttribution" + } }, "avgLogprobs": { - "readOnly": true, "type": "number", "description": "Output only. Average log probability score of the candidate.", - "format": "double" + "format": "double", + "readOnly": true }, - "finishReason": { - "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.", + "content": { "readOnly": true, - "type": "string", + "$ref": "#/components/schemas/Content", + "description": "Output only. Generated content returned from the model." + }, + "finishReason": { + "x-enum-descriptions": [ + "Default value. This value is unused.", + "Natural stop point of the model or provided stop sequence.", + "The maximum number of tokens as specified in the request was reached.", + "The response candidate content was flagged for safety reasons.", + "The response candidate content was flagged for recitation reasons.", + "The response candidate content was flagged for using an unsupported language.", + "Unknown reason.", + "Token generation stopped because the content contains forbidden terms.", + "Token generation stopped for potentially containing prohibited content.", + "Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).", + "The function call generated by the model is invalid.", + "Token generation stopped because generated images contain safety violations.", + "Image generation stopped because generated images has other prohibited content.", + "Image generation stopped because of other miscellaneous issue.", + "The model was expected to generate an image, but none was generated.", + "Image generation stopped due to recitation.", + "Model generated a tool call but no tools were enabled in the request.", + "Model called too many tools consecutively, thus the system exited execution.", + "Request has at least one thought signature missing.", + "Finished due to malformed response." + ], "enum": [ "FINISH_REASON_UNSPECIFIED", "STOP", @@ -5300,149 +5237,258 @@ "MISSING_THOUGHT_SIGNATURE", "MALFORMED_RESPONSE" ], - "x-enum-descriptions": [ - "Default value. This value is unused.", - "Natural stop point of the model or provided stop sequence.", - "The maximum number of tokens as specified in the request was reached.", - "The response candidate content was flagged for safety reasons.", - "The response candidate content was flagged for recitation reasons.", - "The response candidate content was flagged for using an unsupported language.", - "Unknown reason.", - "Token generation stopped because the content contains forbidden terms.", - "Token generation stopped for potentially containing prohibited content.", - "Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).", - "The function call generated by the model is invalid.", - "Token generation stopped because generated images contain safety violations.", - "Image generation stopped because generated images has other prohibited content.", - "Image generation stopped because of other miscellaneous issue.", - "The model was expected to generate an image, but none was generated.", - "Image generation stopped due to recitation.", - "Model generated a tool call but no tools were enabled in the request.", - "Model called too many tools consecutively, thus the system exited execution.", - "Request has at least one thought signature missing.", - "Finished due to malformed response." - ] + "type": "string", + "readOnly": true, + "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens." }, "citationMetadata": { "description": "Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are \"recited\" from copyrighted material in the foundational LLM's training data.", "readOnly": true, "$ref": "#/components/schemas/CitationMetadata" }, - "index": { - "description": "Output only. Index of the candidate in the list of response candidates.", + "logprobsResult": { + "description": "Output only. Log-likelihood scores for the response tokens and top tokens", "readOnly": true, + "$ref": "#/components/schemas/LogprobsResult" + } + }, + "type": "object" + }, + "ListPermissionsResponse": { + "description": "Response from `ListPermissions` containing a paginated list of permissions.", + "properties": { + "permissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Permission" + }, + "description": "Returned permissions." + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "type": "string" + } + }, + "type": "object" + }, + "LogprobsResultCandidate": { + "description": "Candidate for the logprobs token and score.", + "properties": { + "logProbability": { + "description": "The candidate's log probability.", + "format": "float", + "type": "number" + }, + "token": { + "description": "The candidate\u2019s token string value.", + "type": "string" + }, + "tokenId": { "type": "integer", + "description": "The candidate\u2019s token id value.", "format": "int32" + } + }, + "type": "object" + }, + "Tool": { + "description": "Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Next ID: 16", + "properties": { + "codeExecution": { + "$ref": "#/components/schemas/CodeExecution", + "description": "Optional. Enables the model to execute code as part of generation." }, - "finishMessage": { - "readOnly": true, - "type": "string", - "description": "Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set." + "computerUse": { + "description": "Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.", + "$ref": "#/components/schemas/ComputerUse" }, - "groundingMetadata": { - "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.", - "readOnly": true, - "$ref": "#/components/schemas/GroundingMetadata" + "fileSearch": { + "description": "Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.", + "$ref": "#/components/schemas/FileSearch" }, - "groundingAttributions": { - "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", - "readOnly": true, - "type": "array", + "googleMaps": { + "$ref": "#/components/schemas/GoogleMaps", + "description": "Optional. Tool that allows grounding the model's response with geospatial context related to the user's query." + }, + "googleSearchRetrieval": { + "description": "Optional. Retrieval tool that is powered by Google search.", + "$ref": "#/components/schemas/GoogleSearchRetrieval" + }, + "googleSearch": { + "description": "Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", + "$ref": "#/components/schemas/GoogleSearch" + }, + "mcpServers": { "items": { - "$ref": "#/components/schemas/GroundingAttribution" - } + "$ref": "#/components/schemas/McpServer" + }, + "description": "Optional. MCP Servers to connect to.", + "type": "array" + }, + "functionDeclarations": { + "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn.", + "items": { + "$ref": "#/components/schemas/FunctionDeclaration" + }, + "type": "array" + }, + "urlContext": { + "$ref": "#/components/schemas/UrlContext", + "description": "Optional. Tool to support URL context retrieval." + } + }, + "type": "object" + }, + "ReviewSnippet": { + "type": "object", + "description": "Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.", + "properties": { + "reviewId": { + "type": "string", + "description": "The ID of the review snippet." + }, + "title": { + "type": "string", + "description": "Title of the review." + }, + "googleMapsUri": { + "type": "string", + "description": "A link that corresponds to the user review on Google Maps." + } + } + }, + "FunctionResponse": { + "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.", + "properties": { + "name": { + "type": "string", + "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128." + }, + "response": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object." + }, + "description": "Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. \"output\", \"result\", etc. In particular, if the function call failed to execute, the response can have an \"error\" key to return error details to the model." + }, + "id": { + "description": "Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.", + "type": "string" + }, + "willContinue": { + "type": "boolean", + "description": "Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`." }, - "safetyRatings": { - "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", + "parts": { "type": "array", + "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.", "items": { - "$ref": "#/components/schemas/SafetyRating" + "$ref": "#/components/schemas/FunctionResponsePart" } }, - "urlContextMetadata": { - "description": "Output only. Metadata related to url context retrieval tool.", - "readOnly": true, - "$ref": "#/components/schemas/UrlContextMetadata" - } - } - }, - "SafetySetting": { - "type": "object", - "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.", - "properties": { - "category": { - "x-enum-descriptions": [ - "Category is unspecified.", - "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", - "**PaLM** - Content that is rude, disrespectful, or profane.", - "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", - "**PaLM** - Contains references to sexual acts or other lewd content.", - "**PaLM** - Promotes unchecked medical advice.", - "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", - "**Gemini** - Harassment content.", - "**Gemini** - Hate speech and content.", - "**Gemini** - Sexually explicit content.", - "**Gemini** - Dangerous content.", - "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." - ], + "scheduling": { + "description": "Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.", "type": "string", - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true - ], - "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT", - "HARM_CATEGORY_CIVIC_INTEGRITY" - ], - "description": "Required. The category for this setting." - }, - "threshold": { - "description": "Required. Controls the probability threshold at which harm is blocked.", "x-enum-descriptions": [ - "Threshold is unspecified.", - "Content with NEGLIGIBLE will be allowed.", - "Content with NEGLIGIBLE and LOW will be allowed.", - "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.", - "All content will be allowed.", - "Turn off the safety filter." + "This value is unused.", + "Only add the result to the conversation context, do not interrupt or trigger generation.", + "Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.", + "Add the result to the conversation context, interrupt ongoing generation and prompt to generate output." ], - "type": "string", "enum": [ - "HARM_BLOCK_THRESHOLD_UNSPECIFIED", - "BLOCK_LOW_AND_ABOVE", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_ONLY_HIGH", - "BLOCK_NONE", - "OFF" + "SCHEDULING_UNSPECIFIED", + "SILENT", + "WHEN_IDLE", + "INTERRUPT" ] } + }, + "type": "object" + }, + "Part": { + "type": "object", + "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", + "properties": { + "toolResponse": { + "$ref": "#/components/schemas/ToolResponse", + "description": "The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`." + }, + "thoughtSignature": { + "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.", + "format": "byte", + "type": "string" + }, + "text": { + "description": "Inline text.", + "type": "string" + }, + "thought": { + "type": "boolean", + "description": "Optional. Indicates if the part is thought from the model." + }, + "functionCall": { + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", + "$ref": "#/components/schemas/FunctionCall" + }, + "executableCode": { + "description": "Code generated by the model that is meant to be executed.", + "$ref": "#/components/schemas/ExecutableCode" + }, + "videoMetadata": { + "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.", + "$ref": "#/components/schemas/VideoMetadata" + }, + "inlineData": { + "description": "Inline media bytes.", + "$ref": "#/components/schemas/Blob" + }, + "functionResponse": { + "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.", + "$ref": "#/components/schemas/FunctionResponse" + }, + "codeExecutionResult": { + "$ref": "#/components/schemas/CodeExecutionResult", + "description": "Result of executing the `ExecutableCode`." + }, + "toolCall": { + "$ref": "#/components/schemas/ToolCall", + "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API." + }, + "mediaResolution": { + "description": "Optional. Media resolution for the input media.", + "$ref": "#/components/schemas/MediaResolution" + }, + "partMetadata": { + "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.", + "additionalProperties": { + "description": "Properties of the object." + }, + "type": "object" + }, + "fileData": { + "$ref": "#/components/schemas/FileData", + "description": "URI based data." + } } }, "ToolResponse": { + "type": "object", "description": "The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.", "properties": { + "response": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object." + }, + "description": "Optional. The tool response." + }, + "id": { + "description": "Optional. The identifier of the tool call this response is for.", + "type": "string" + }, "toolType": { "description": "Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.", + "type": "string", "x-enum-descriptions": [ "Unspecified tool type.", "Google search tool, maps to Tool.google_search.search_types.web_search.", @@ -5451,7 +5497,6 @@ "Google maps tool, maps to Tool.google_maps.", "File search tool, maps to Tool.file_search." ], - "type": "string", "enum": [ "TOOL_TYPE_UNSPECIFIED", "GOOGLE_SEARCH_WEB", @@ -5460,1211 +5505,1166 @@ "GOOGLE_MAPS", "FILE_SEARCH" ] - }, - "id": { - "description": "Optional. The identifier of the tool call this response is for.", - "type": "string" - }, - "response": { - "description": "Optional. The tool response.", - "additionalProperties": { - "description": "Properties of the object." - }, - "type": "object" - } - }, - "type": "object" - }, - "GenerateContentBatch": { - "type": "object", - "description": "A resource representing a batch of `GenerateContent` requests.", - "properties": { - "model": { - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." - }, - "createTime": { - "readOnly": true, - "type": "string", - "description": "Output only. The time at which the batch was created.", - "format": "google-datetime" - }, - "inputConfig": { - "$ref": "#/components/schemas/InputConfig", - "description": "Required. Input configuration of the instances on which batch processing are performed." - }, - "output": { - "readOnly": true, - "$ref": "#/components/schemas/GenerateContentBatchOutput", - "description": "Output only. The output of the batch request." - }, - "displayName": { - "type": "string", - "description": "Required. The user-defined name of this batch." - }, - "state": { - "description": "Output only. The state of the batch.", - "readOnly": true, - "type": "string", - "enum": [ - "BATCH_STATE_UNSPECIFIED", - "BATCH_STATE_PENDING", - "BATCH_STATE_RUNNING", - "BATCH_STATE_SUCCEEDED", - "BATCH_STATE_FAILED", - "BATCH_STATE_CANCELLED", - "BATCH_STATE_EXPIRED" - ], - "x-enum-descriptions": [ - "The batch state is unspecified.", - "The service is preparing to run the batch.", - "The batch is in progress.", - "The batch completed successfully.", - "The batch failed.", - "The batch has been cancelled.", - "The batch has expired." - ] - }, - "endTime": { - "description": "Output only. The time at which the batch processing completed.", - "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "priority": { - "type": "string", - "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", - "format": "int64" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`." - }, - "batchStats": { - "readOnly": true, - "$ref": "#/components/schemas/BatchStats", - "description": "Output only. Stats about the batch." - }, - "updateTime": { - "readOnly": true, - "type": "string", - "description": "Output only. The time at which the batch was last updated.", - "format": "google-datetime" } } }, - "AsyncBatchEmbedContentRequest": { - "description": "Request for an `AsyncBatchEmbedContent` operation.", - "properties": { - "batch": { - "$ref": "#/components/schemas/EmbedContentBatch", - "description": "Required. The batch to create." - } - }, - "type": "object" - }, - "InlinedEmbedContentRequest": { + "InlinedEmbedContentResponse": { "type": "object", - "description": "The request to be processed in the batch.", + "description": "The response to a single request in the batch.", "properties": { - "request": { - "$ref": "#/components/schemas/EmbedContentRequest", - "description": "Required. The request to be processed in the batch." + "error": { + "description": "Output only. The error encountered while processing the request.", + "readOnly": true, + "$ref": "#/components/schemas/Status" + }, + "response": { + "description": "Output only. The response to the request.", + "readOnly": true, + "$ref": "#/components/schemas/EmbedContentResponse" }, "metadata": { "type": "object", - "description": "Optional. The metadata to be associated with the request.", + "description": "Output only. The metadata associated with the request.", + "readOnly": true, "additionalProperties": { "description": "Properties of the object." } } } }, - "SearchTypes": { - "type": "object", - "description": "Different types of search that can be enabled on the GoogleSearch tool.", + "RegisterFilesRequest": { + "description": "Request for `RegisterFiles`.", "properties": { - "webSearch": { - "$ref": "#/components/schemas/WebSearch", - "description": "Optional. Enables web search. Only text results are returned." - }, - "imageSearch": { - "$ref": "#/components/schemas/ImageSearch", - "description": "Optional. Enables image search. Image bytes are returned." + "uris": { + "type": "array", + "description": "Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.", + "items": { + "type": "string" + } } - } + }, + "type": "object" }, - "GroundingChunkCustomMetadata": { - "description": "User provided metadata about the GroundingFact.", + "ImageSearch": { + "type": "object", + "description": "Image search for grounding and related configurations.", + "properties": {} + }, + "GoogleAiGenerativelanguageV1betaGroundingSupport": { + "type": "object", + "description": "Grounding support.", "properties": { - "stringValue": { - "description": "Optional. The string value of the metadata.", - "type": "string" + "segment": { + "$ref": "#/components/schemas/GoogleAiGenerativelanguageV1betaSegment", + "description": "Segment of the content this support belongs to." }, - "stringListValue": { - "description": "Optional. A list of string values for the metadata.", - "$ref": "#/components/schemas/GroundingChunkStringList" + "groundingChunkIndices": { + "description": "Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order).", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" }, - "key": { - "description": "The key of the metadata.", - "type": "string" + "confidenceScores": { + "type": "array", + "items": { + "format": "float", + "type": "number" + }, + "description": "Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices." }, - "numericValue": { - "type": "number", - "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.", - "format": "float" + "renderedParts": { + "type": "array", + "readOnly": true, + "items": { + "format": "int32", + "type": "integer" + }, + "description": "Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source." } - }, - "type": "object" + } }, - "CustomLongRunningOperation": { + "Web": { + "type": "object", + "description": "Chunk from the web.", "properties": { - "done": { - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", - "type": "boolean" - }, - "name": { + "title": { "type": "string", - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`." - }, - "response": { - "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - }, - "type": "object" + "description": "Output only. Title of the chunk.", + "readOnly": true }, + "uri": { + "description": "Output only. URI reference of the chunk.", + "readOnly": true, + "type": "string" + } + } + }, + "Empty": { + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "properties": {} + }, + "InlinedResponse": { + "type": "object", + "description": "The response to a single request in the batch.", + "properties": { "metadata": { - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "description": "Output only. The metadata associated with the request.", + "readOnly": true, "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." + "description": "Properties of the object." }, "type": "object" }, "error": { - "$ref": "#/components/schemas/Status", - "description": "The error result of the operation in case of failure or cancellation." + "description": "Output only. The error encountered while processing the request.", + "readOnly": true, + "$ref": "#/components/schemas/Status" + }, + "response": { + "readOnly": true, + "$ref": "#/components/schemas/GenerateContentResponse", + "description": "Output only. The response to the request." } - }, - "type": "object" + } }, - "Part": { + "InlinedEmbedContentRequest": { "type": "object", - "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", + "description": "The request to be processed in the batch.", "properties": { - "functionCall": { - "$ref": "#/components/schemas/FunctionCall", - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values." - }, - "videoMetadata": { - "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.", - "$ref": "#/components/schemas/VideoMetadata" - }, - "functionResponse": { - "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.", - "$ref": "#/components/schemas/FunctionResponse" - }, - "toolCall": { - "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.", - "$ref": "#/components/schemas/ToolCall" - }, - "inlineData": { - "$ref": "#/components/schemas/Blob", - "description": "Inline media bytes." + "request": { + "description": "Required. The request to be processed in the batch.", + "$ref": "#/components/schemas/EmbedContentRequest" }, - "partMetadata": { + "metadata": { "type": "object", - "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.", "additionalProperties": { "description": "Properties of the object." - } - }, - "text": { - "type": "string", - "description": "Inline text." - }, - "thoughtSignature": { - "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.", - "type": "string", - "format": "byte" - }, - "mediaResolution": { - "$ref": "#/components/schemas/MediaResolution", - "description": "Optional. Media resolution for the input media." - }, - "toolResponse": { - "$ref": "#/components/schemas/ToolResponse", - "description": "The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`." - }, - "thought": { - "description": "Optional. Indicates if the part is thought from the model.", - "type": "boolean" - }, - "fileData": { - "description": "URI based data.", - "$ref": "#/components/schemas/FileData" - }, - "executableCode": { - "description": "Code generated by the model that is meant to be executed.", - "$ref": "#/components/schemas/ExecutableCode" - }, - "codeExecutionResult": { - "description": "Result of executing the `ExecutableCode`.", - "$ref": "#/components/schemas/CodeExecutionResult" + }, + "description": "Optional. The metadata to be associated with the request." } } }, - "WebSearch": { - "type": "object", - "description": "Standard web search for grounding and related configurations.", - "properties": {} - }, - "GeneratedFile": { - "type": "object", - "description": "A file generated on behalf of a user.", + "McpServer": { + "description": "A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6", "properties": { + "streamableHttpTransport": { + "description": "A transport that can stream HTTP requests and responses.", + "$ref": "#/components/schemas/StreamableHttpTransport" + }, "name": { "type": "string", - "description": "Identifier. The name of the generated file. Example: `generatedFiles/abc-123`" - }, - "mimeType": { - "description": "MIME type of the generatedFile.", - "type": "string" + "description": "The name of the MCPServer." + } + }, + "type": "object" + }, + "ModalityTokenCount": { + "description": "Represents token counting info for a single modality.", + "properties": { + "tokenCount": { + "type": "integer", + "description": "Number of tokens.", + "format": "int32" }, - "state": { + "modality": { + "description": "The modality associated with this token count.", + "type": "string", "x-enum-descriptions": [ - "The default value. This value is used if the state is omitted.", - "Being generated.", - "Generated and is ready for download.", - "Failed to generate the GeneratedFile." + "Unspecified modality.", + "Plain text.", + "Image.", + "Video.", + "Audio.", + "Document, e.g. PDF." ], - "description": "Output only. The state of the GeneratedFile.", - "readOnly": true, + "enum": [ + "MODALITY_UNSPECIFIED", + "TEXT", + "IMAGE", + "VIDEO", + "AUDIO", + "DOCUMENT" + ] + } + }, + "type": "object" + }, + "CodeExecutionResult": { + "description": "Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.", + "properties": { + "outcome": { + "description": "Required. Outcome of the code execution.", "type": "string", + "x-enum-descriptions": [ + "Unspecified status. This value should not be used.", + "Code execution completed successfully. `output` contains the stdout, if any.", + "Code execution failed. `output` contains the stderr and stdout, if any.", + "Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present." + ], "enum": [ - "STATE_UNSPECIFIED", - "GENERATING", - "GENERATED", - "FAILED" + "OUTCOME_UNSPECIFIED", + "OUTCOME_OK", + "OUTCOME_FAILED", + "OUTCOME_DEADLINE_EXCEEDED" ] }, - "error": { - "$ref": "#/components/schemas/Status", - "description": "Error details if the GeneratedFile ends up in the STATE_FAILED state." + "output": { + "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.", + "type": "string" + }, + "id": { + "type": "string", + "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id." + } + }, + "type": "object" + }, + "GoogleSearch": { + "description": "GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", + "properties": { + "timeRangeFilter": { + "$ref": "#/components/schemas/Interval", + "description": "Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa)." + }, + "searchTypes": { + "description": "Optional. The set of search types to enable. If not set, web search is enabled by default.", + "$ref": "#/components/schemas/SearchTypes" } - } + }, + "type": "object" }, - "FunctionCall": { - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", + "ListCachedContentsResponse": { + "type": "object", + "description": "Response with CachedContents list.", "properties": { - "name": { - "type": "string", - "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128." - }, - "id": { - "description": "Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.", + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" }, + "cachedContents": { + "description": "List of cached contents.", + "items": { + "$ref": "#/components/schemas/CachedContent" + }, + "type": "array" + } + } + }, + "ToolCall": { + "description": "A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.", + "properties": { "args": { - "description": "Optional. The function parameters and values in JSON object format.", + "description": "Optional. The tool call arguments. Example: {\"arg1\" : \"value1\", \"arg2\" : \"value2\" , ...}", "additionalProperties": { "description": "Properties of the object." }, "type": "object" + }, + "id": { + "description": "Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.", + "type": "string" + }, + "toolType": { + "type": "string", + "x-enum-descriptions": [ + "Unspecified tool type.", + "Google search tool, maps to Tool.google_search.search_types.web_search.", + "Image search tool, maps to Tool.google_search.search_types.image_search.", + "URL context tool, maps to Tool.url_context.", + "Google maps tool, maps to Tool.google_maps.", + "File search tool, maps to Tool.file_search." + ], + "enum": [ + "TOOL_TYPE_UNSPECIFIED", + "GOOGLE_SEARCH_WEB", + "GOOGLE_SEARCH_IMAGE", + "URL_CONTEXT", + "GOOGLE_MAPS", + "FILE_SEARCH" + ], + "description": "Required. The type of tool that was called." } }, "type": "object" }, - "DynamicRetrievalConfig": { + "BatchGenerateContentRequest": { "type": "object", - "description": "Describes the options to customize dynamic retrieval.", + "description": "Request for a `BatchGenerateContent` operation.", "properties": { - "dynamicThreshold": { - "format": "float", - "description": "The threshold to be used in dynamic retrieval. If not set, a system default value is used.", - "type": "number" - }, - "mode": { - "description": "The mode of the predictor to be used in dynamic retrieval.", - "x-enum-descriptions": [ - "Always trigger retrieval.", - "Run retrieval only when system decides it is necessary." - ], - "type": "string", - "enum": [ - "MODE_UNSPECIFIED", - "MODE_DYNAMIC" - ] + "batch": { + "$ref": "#/components/schemas/GenerateContentBatch", + "description": "Required. The batch to create." } } }, - "Tool": { + "ListDocumentsResponse": { "type": "object", - "description": "Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Next ID: 16", + "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", "properties": { - "functionDeclarations": { - "type": "array", - "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn.", - "items": { - "$ref": "#/components/schemas/FunctionDeclaration" - } - }, - "googleSearchRetrieval": { - "$ref": "#/components/schemas/GoogleSearchRetrieval", - "description": "Optional. Retrieval tool that is powered by Google search." - }, - "codeExecution": { - "$ref": "#/components/schemas/CodeExecution", - "description": "Optional. Enables the model to execute code as part of generation." - }, - "googleSearch": { - "$ref": "#/components/schemas/GoogleSearch", - "description": "Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google." - }, - "computerUse": { - "description": "Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.", - "$ref": "#/components/schemas/ComputerUse" - }, - "mcpServers": { + "documents": { "items": { - "$ref": "#/components/schemas/McpServer" + "$ref": "#/components/schemas/Document" }, - "type": "array", - "description": "Optional. MCP Servers to connect to." - }, - "urlContext": { - "description": "Optional. Tool to support URL context retrieval.", - "$ref": "#/components/schemas/UrlContext" - }, - "googleMaps": { - "description": "Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.", - "$ref": "#/components/schemas/GoogleMaps" + "description": "The returned `Document`s.", + "type": "array" }, - "fileSearch": { - "$ref": "#/components/schemas/FileSearch", - "description": "Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora." + "nextPageToken": { + "type": "string", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." } } }, - "FunctionCallingConfig": { - "type": "object", - "description": "Configuration for specifying function calling behavior.", + "UrlContextMetadata": { + "description": "Metadata related to url context retrieval tool.", "properties": { - "allowedFunctionNames": { + "urlMetadata": { "type": "array", - "description": "Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names.", "items": { - "type": "string" - } - }, - "mode": { - "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.", - "x-enum-descriptions": [ - "Unspecified function calling mode. This value should not be used.", - "Default model behavior, model decides to predict either a function call or a natural language response.", - "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".", - "Model will not predict any function call. Model behavior is same as when not passing any function declarations.", - "Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\"." - ], - "type": "string", - "enum": [ - "MODE_UNSPECIFIED", - "AUTO", - "ANY", - "NONE", - "VALIDATED" - ] + "$ref": "#/components/schemas/UrlMetadata" + }, + "description": "List of url context." } - } + }, + "type": "object" }, - "GenerationConfig": { + "InlinedResponses": { "type": "object", - "description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.", + "description": "The responses to the requests in the batch.", "properties": { - "mediaResolution": { - "description": "Optional. If specified, the media resolution specified will be used.", - "x-enum-descriptions": [ - "Media resolution has not been set.", - "Media resolution set to low (64 tokens).", - "Media resolution set to medium (256 tokens).", - "Media resolution set to high (zoomed reframing with 256 tokens)." - ], - "type": "string", - "enum": [ - "MEDIA_RESOLUTION_UNSPECIFIED", - "MEDIA_RESOLUTION_LOW", - "MEDIA_RESOLUTION_MEDIUM", - "MEDIA_RESOLUTION_HIGH" - ] - }, - "topP": { - "type": "number", - "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", - "format": "float" - }, - "topK": { - "description": "Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", - "type": "integer", - "format": "int32" - }, - "imageConfig": { - "description": "Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.", - "$ref": "#/components/schemas/ImageConfig" - }, - "maxOutputTokens": { - "type": "integer", - "description": "Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.", - "format": "int32" - }, - "temperature": { - "type": "number", - "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0].", - "format": "float" - }, - "responseJsonSchema": { - "description": "Optional. An internal detail. Use `responseJsonSchema` rather than this field." - }, - "logprobs": { - "format": "int32", - "description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20].", - "type": "integer" - }, - "responseSchema": { - "$ref": "#/components/schemas/Schema", - "description": "Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible `response_mime_type` must also be set. Compatible MIME types: `application/json`: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details." - }, - "presencePenalty": { - "type": "number", - "description": "Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.", - "format": "float" - }, - "stopSequences": { + "inlinedResponses": { + "readOnly": true, "items": { - "type": "string" + "$ref": "#/components/schemas/InlinedResponse" }, - "description": "Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response.", - "type": "array" - }, - "responseMimeType": { - "description": "Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types.", - "type": "string" - }, - "responseLogprobs": { - "type": "boolean", - "description": "Optional. If true, export the logprobs results in response." - }, - "thinkingConfig": { - "$ref": "#/components/schemas/ThinkingConfig", - "description": "Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking." - }, - "responseModalities": { - "type": "array", - "description": "Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text.", - "items": { - "x-enum-descriptions": [ - "Default value.", - "Indicates the model should return text.", - "Indicates the model should return images.", - "Indicates the model should return audio.", - "Indicates the model should return video." - ], - "type": "string", - "enum": [ - "MODALITY_UNSPECIFIED", - "TEXT", - "IMAGE", - "AUDIO", - "VIDEO" - ] - } - }, - "enableEnhancedCivicAnswers": { - "description": "Optional. Enables enhanced civic answers. It may not be available for all models.", - "type": "boolean" - }, - "seed": { - "format": "int32", + "description": "Output only. The responses to the requests in the batch.", + "type": "array" + } + } + }, + "WhiteSpaceConfig": { + "type": "object", + "description": "Configuration for a white space chunking algorithm [white space delimited].", + "properties": { + "maxOverlapTokens": { "type": "integer", - "description": "Optional. Seed used in decoding. If not set, the request uses a randomly generated seed." + "description": "Maximum number of overlapping tokens between two adjacent chunks.", + "format": "int32" }, - "candidateCount": { + "maxTokensPerChunk": { + "description": "Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow.", "format": "int32", - "description": "Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)", "type": "integer" - }, - "frequencyPenalty": { - "description": "Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit.", - "type": "number", - "format": "float" - }, - "speechConfig": { - "description": "Optional. The speech generation config.", - "$ref": "#/components/schemas/SpeechConfig" } } }, - "Maps": { - "description": "A grounding chunk from Google Maps. A Maps chunk corresponds to a single place.", + "ImageConfig": { + "description": "Config for image generation features.", "properties": { - "placeId": { - "description": "The ID of the place, in `places/{place_id}` format. A user can use this ID to look up that place.", - "type": "string" - }, - "placeAnswerSources": { - "description": "Sources that provide answers about the features of a given place in Google Maps.", - "$ref": "#/components/schemas/PlaceAnswerSources" - }, - "text": { - "type": "string", - "description": "Text description of the place answer." - }, - "title": { + "aspectRatio": { "type": "string", - "description": "Title of the place." + "description": "Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, or `21:9`. If not specified, the model will choose a default aspect ratio based on any reference images provided." }, - "uri": { + "imageSize": { "type": "string", - "description": "URI reference of the place." + "description": "Optional. Specifies the size of generated images. Supported values are `512`, `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`." } }, "type": "object" }, - "TunedModel": { + "CreateFileRequest": { "type": "object", - "description": "A fine-tuned model created using ModelService.CreateTunedModel.", + "description": "Request for `CreateFile`.", "properties": { - "displayName": { + "file": { + "description": "Optional. Metadata for the file to create.", + "$ref": "#/components/schemas/File" + } + } + }, + "GeneratedFile": { + "type": "object", + "description": "A file generated on behalf of a user.", + "properties": { + "mimeType": { "type": "string", - "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces." + "description": "MIME type of the generatedFile." }, "state": { "x-enum-descriptions": [ - "The default value. This value is unused.", - "The model is being created.", - "The model is ready to be used.", - "The model failed to be created." + "The default value. This value is used if the state is omitted.", + "Being generated.", + "Generated and is ready for download.", + "Failed to generate the GeneratedFile." ], - "description": "Output only. The state of the tuned model.", - "readOnly": true, - "type": "string", "enum": [ "STATE_UNSPECIFIED", - "CREATING", - "ACTIVE", + "GENERATING", + "GENERATED", "FAILED" - ] + ], + "description": "Output only. The state of the GeneratedFile.", + "readOnly": true, + "type": "string" }, - "readerProjectNumbers": { - "items": { - "type": "string", - "format": "int64" - }, - "type": "array", - "description": "Optional. List of project numbers that have read access to the tuned model." + "error": { + "$ref": "#/components/schemas/Status", + "description": "Error details if the GeneratedFile ends up in the STATE_FAILED state." }, - "topP": { - "format": "float", - "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.", - "type": "number" + "name": { + "description": "Identifier. The name of the generated file. Example: `generatedFiles/abc-123`", + "type": "string" + } + } + }, + "FileData": { + "description": "URI based data.", + "properties": { + "mimeType": { + "type": "string", + "description": "Optional. The IANA standard MIME type of the source data." }, - "topK": { - "type": "integer", - "description": "Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.", - "format": "int32" + "fileUri": { + "type": "string", + "description": "Required. URI." + } + }, + "type": "object" + }, + "Image": { + "type": "object", + "description": "Chunk from image search.", + "properties": { + "title": { + "type": "string", + "description": "The title of the web page that the image is from." }, - "temperature": { - "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.", - "type": "number", - "format": "float" + "sourceUri": { + "description": "The web page URI for attribution.", + "type": "string" }, - "name": { - "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", + "imageUri": { + "type": "string", + "description": "The image asset URL." + }, + "domain": { + "type": "string", + "description": "The root domain of the web page that the image is from, e.g. \"example.com\"." + } + } + }, + "GroundingPassageId": { + "description": "Identifier for a part within a `GroundingPassage`.", + "properties": { + "passageId": { "readOnly": true, + "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.", "type": "string" }, - "tuningTask": { - "description": "Required. The tuning task that creates the tuned model.", - "$ref": "#/components/schemas/TuningTask" - }, - "updateTime": { - "format": "google-datetime", + "partIndex": { + "type": "integer", "readOnly": true, + "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", + "format": "int32" + } + }, + "type": "object" + }, + "CreateFileResponse": { + "type": "object", + "description": "Response for `CreateFile`.", + "properties": { + "file": { + "description": "Metadata for the created file.", + "$ref": "#/components/schemas/File" + } + } + }, + "GoogleAiGenerativelanguageV1betaSegment": { + "description": "Segment of the content.", + "properties": { + "text": { "type": "string", - "description": "Output only. The timestamp when this model was updated." + "description": "The text corresponding to the segment from the response." }, - "baseModel": { + "endIndex": { + "type": "integer", + "description": "End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.", + "format": "int32" + }, + "partIndex": { + "description": "The index of a Part object within its parent Content object.", + "format": "int32", + "type": "integer" + }, + "startIndex": { + "type": "integer", + "description": "Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.", + "format": "int32" + } + }, + "type": "object" + }, + "AsyncBatchEmbedContentRequest": { + "description": "Request for an `AsyncBatchEmbedContent` operation.", + "properties": { + "batch": { + "description": "Required. The batch to create.", + "$ref": "#/components/schemas/EmbedContentBatch" + } + }, + "type": "object" + }, + "ModelStatus": { + "description": "The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.", + "properties": { + "retirementTime": { "type": "string", - "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`" + "description": "The time at which the model will be retired.", + "format": "google-datetime" }, - "createTime": { - "format": "google-datetime", - "readOnly": true, + "modelStage": { + "x-enum-descriptions": [ + "Unspecified model stage.", + "The underlying model is subject to lots of tunings.", + "Models in this stage are for experimental purposes only.", + "Models in this stage are more mature than experimental models.", + "Models in this stage are considered stable and ready for production use.", + "If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.", + "Models in this stage are deprecated. These models cannot be used.", + "Models in this stage are retired. These models cannot be used." + ], + "enum": [ + "MODEL_STAGE_UNSPECIFIED", + "UNSTABLE_EXPERIMENTAL", + "EXPERIMENTAL", + "PREVIEW", + "STABLE", + "LEGACY", + "DEPRECATED", + "RETIRED" + ], + "enumDeprecated": [ + false, + true, + false, + false, + false, + false, + true, + false + ], + "type": "string", + "description": "The stage of the underlying model." + }, + "message": { + "description": "A message explaining the model status.", + "type": "string" + } + }, + "type": "object" + }, + "CitationSource": { + "type": "object", + "description": "A citation to a source for a portion of a specific response.", + "properties": { + "endIndex": { + "type": "integer", + "description": "Optional. End of the attributed segment, exclusive.", + "format": "int32" + }, + "license": { "type": "string", - "description": "Output only. The timestamp when this model was created." + "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations." + }, + "startIndex": { + "type": "integer", + "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.", + "format": "int32" }, - "description": { - "description": "Optional. A short description of this model.", + "uri": { + "description": "Optional. URI that is attributed as a source for a portion of the text.", "type": "string" - }, - "tunedModelSource": { - "description": "Optional. TunedModel to use as the starting point for training the new model.", - "$ref": "#/components/schemas/TunedModelSource" } } }, - "SpeakerVoiceConfig": { - "description": "The configuration for a single speaker in a multi speaker setup.", + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", "properties": { - "speaker": { - "type": "string", - "description": "Required. The name of the speaker to use. Should be the same as in the prompt." + "operations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Operation" + }, + "description": "A list of operations that matches the specified filter in the request." }, - "voiceConfig": { - "description": "Required. The configuration for the voice to use.", - "$ref": "#/components/schemas/VoiceConfig" + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "unreachable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations." } }, "type": "object" }, - "ExecutableCode": { - "description": "Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.", + "PlaceAnswerSources": { + "type": "object", + "description": "Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: \"does Bar Foo have Wifi\" or \"is Foo Bar wheelchair accessible?\"). Currently we only support review snippets as sources.", "properties": { - "code": { - "description": "Required. The code to be executed.", - "type": "string" - }, - "id": { - "type": "string", - "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`." - }, - "language": { - "type": "string", - "enum": [ - "LANGUAGE_UNSPECIFIED", - "PYTHON" - ], - "description": "Required. Programming language of the `code`.", - "x-enum-descriptions": [ - "Unspecified language. This value should not be used.", - "Python >= 3.10, with numpy and simpy available. Python is the default language." - ] + "reviewSnippets": { + "items": { + "$ref": "#/components/schemas/ReviewSnippet" + }, + "description": "Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.", + "type": "array" } - }, - "type": "object" + } }, - "VoiceConfig": { - "description": "The configuration for the voice to use.", + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", "properties": { - "prebuiltVoiceConfig": { - "$ref": "#/components/schemas/PrebuiltVoiceConfig", - "description": "The configuration for the prebuilt voice to use." + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use." } }, "type": "object" }, - "UrlContext": { - "type": "object", - "description": "Tool to support URL context retrieval.", - "properties": {} - }, - "GenerateContentResponse": { - "description": "Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`.", + "TuningTask": { + "description": "Tuning tasks that create tuned models.", "properties": { - "modelStatus": { - "readOnly": true, - "$ref": "#/components/schemas/ModelStatus", - "description": "Output only. The current model status of this model." + "startTime": { + "type": "string", + "description": "Output only. The timestamp when tuning this model started.", + "format": "google-datetime", + "readOnly": true }, - "candidates": { - "description": "Candidate responses from the model.", + "snapshots": { "type": "array", + "description": "Output only. Metrics collected during tuning.", + "readOnly": true, "items": { - "$ref": "#/components/schemas/Candidate" + "$ref": "#/components/schemas/TuningSnapshot" } }, - "responseId": { - "description": "Output only. response_id is used to identify each response.", - "readOnly": true, - "type": "string" - }, - "promptFeedback": { - "$ref": "#/components/schemas/PromptFeedback", - "description": "Returns the prompt's feedback related to the content filters." + "trainingData": { + "description": "Required. Input only. Immutable. The model training data.", + "$ref": "#/components/schemas/Dataset" }, - "modelVersion": { + "completeTime": { "readOnly": true, - "type": "string", - "description": "Output only. The model version used to generate the response." + "description": "Output only. The timestamp when tuning this model completed.", + "format": "google-datetime", + "type": "string" }, - "usageMetadata": { - "readOnly": true, - "$ref": "#/components/schemas/UsageMetadata", - "description": "Output only. Metadata on the generation requests' token usage." + "hyperparameters": { + "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.", + "$ref": "#/components/schemas/Hyperparameters" } }, "type": "object" }, + "Hyperparameters": { + "type": "object", + "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", + "properties": { + "learningRate": { + "type": "number", + "description": "Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.", + "format": "float" + }, + "learningRateMultiplier": { + "type": "number", + "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.", + "format": "float" + }, + "epochCount": { + "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used.", + "format": "int32", + "type": "integer" + }, + "batchSize": { + "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.", + "format": "int32", + "type": "integer" + } + } + }, "ContentEmbedding": { + "type": "object", "description": "A list of floats representing an embedding.", "properties": { "values": { + "type": "array", "items": { - "type": "number", - "format": "float" + "format": "float", + "type": "number" }, - "type": "array", "description": "The embedding values. This is for 3P users only and will not be populated for 1P calls." }, "shape": { "type": "array", - "description": "This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048]).", "items": { "type": "integer", "format": "int32" - } + }, + "description": "This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048])." } - }, - "type": "object" + } }, - "SemanticRetrieverChunk": { + "CachedContent": { "type": "object", - "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", + "description": "Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for.", "properties": { - "chunk": { - "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`", + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tool" + }, + "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response" + }, + "ttl": { + "type": "string", + "description": "Input only. New TTL for this resource, input only.", + "format": "google-duration" + }, + "createTime": { + "type": "string", + "description": "Output only. Creation time of the cache entry.", + "format": "google-datetime", + "readOnly": true + }, + "updateTime": { + "description": "Output only. When the cache entry was last updated in UTC time.", + "format": "google-datetime", "readOnly": true, "type": "string" }, - "source": { - "readOnly": true, + "model": { "type": "string", - "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`" - } - } - }, - "InputEmbedContentConfig": { - "description": "Configures the input to the batch request.", - "properties": { - "fileName": { - "description": "The name of the `File` containing the input requests.", + "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`" + }, + "systemInstruction": { + "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only.", + "$ref": "#/components/schemas/Content" + }, + "toolConfig": { + "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools.", + "$ref": "#/components/schemas/ToolConfig" + }, + "expireTime": { + "description": "Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.", + "format": "google-datetime", "type": "string" }, - "requests": { - "description": "The requests to be processed in the batch.", - "$ref": "#/components/schemas/InlinedEmbedContentRequests" - } - }, - "type": "object" - }, - "ModalityTokenCount": { - "type": "object", - "description": "Represents token counting info for a single modality.", - "properties": { - "modality": { - "type": "string", - "enum": [ - "MODALITY_UNSPECIFIED", - "TEXT", - "IMAGE", - "VIDEO", - "AUDIO", - "DOCUMENT" - ], - "description": "The modality associated with this token count.", - "x-enum-descriptions": [ - "Unspecified modality.", - "Plain text.", - "Image.", - "Video.", - "Audio.", - "Document, e.g. PDF." - ] + "displayName": { + "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.", + "type": "string" }, - "tokenCount": { - "format": "int32", - "description": "Number of tokens.", - "type": "integer" - } - } - }, - "RegisterFilesRequest": { - "description": "Request for `RegisterFiles`.", - "properties": { - "uris": { + "contents": { + "description": "Optional. Input only. Immutable. The content to cache.", "items": { - "type": "string" + "$ref": "#/components/schemas/Content" }, - "type": "array", - "description": "Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`." + "type": "array" + }, + "name": { + "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", + "readOnly": true, + "type": "string" + }, + "usageMetadata": { + "description": "Output only. Metadata on the usage of the cached content.", + "readOnly": true, + "$ref": "#/components/schemas/CachedContentUsageMetadata" } - }, - "type": "object" + } }, - "ListCorporaResponse": { - "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", + "VideoFileMetadata": { + "description": "Metadata for a video `File`.", "properties": { - "corpora": { - "description": "The returned corpora.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Corpus" - } - }, - "nextPageToken": { + "videoDuration": { "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + "description": "Duration of the video.", + "format": "google-duration" } }, "type": "object" }, - "GroundingMetadata": { - "description": "Metadata returned to client when grounding is enabled.", + "ImportFileRequest": { + "description": "Request for `ImportFile` to import a File API file with a `FileSearchStore`.", "properties": { - "groundingSupports": { - "description": "List of grounding support.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleAiGenerativelanguageV1betaGroundingSupport" - } - }, - "webSearchQueries": { - "items": { - "type": "string" - }, - "type": "array", - "description": "Web search queries for the following-up web search." - }, - "searchEntryPoint": { - "description": "Optional. Google search entry for the following-up web searches.", - "$ref": "#/components/schemas/SearchEntryPoint" - }, - "imageSearchQueries": { - "description": "Image search queries used for grounding.", - "type": "array", - "items": { - "type": "string" - } + "fileName": { + "description": "Required. The name of the `File` to import. Example: `files/abc-123`", + "type": "string" }, - "retrievalMetadata": { - "description": "Metadata related to retrieval in the grounding flow.", - "$ref": "#/components/schemas/RetrievalMetadata" + "chunkingConfig": { + "$ref": "#/components/schemas/ChunkingConfig", + "description": "Optional. Config for telling the service how to chunk the file. If not provided, the service will use default parameters." }, - "groundingChunks": { + "customMetadata": { + "description": "Custom metadata to be associated with the file.", "items": { - "$ref": "#/components/schemas/GroundingChunk" + "$ref": "#/components/schemas/CustomMetadata" }, - "description": "List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses.", "type": "array" - }, - "googleMapsWidgetContextToken": { - "type": "string", - "description": "Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled." } }, "type": "object" }, - "InlinedRequest": { - "type": "object", - "description": "The request to be processed in the batch.", + "GenerateContentBatchOutput": { + "description": "The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.", "properties": { - "metadata": { - "description": "Optional. The metadata to be associated with the request.", - "additionalProperties": { - "description": "Properties of the object." - }, - "type": "object" + "responsesFile": { + "readOnly": true, + "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", + "type": "string" }, - "request": { - "$ref": "#/components/schemas/GenerateContentRequest", - "description": "Required. The request to be processed in the batch." + "inlinedResponses": { + "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", + "readOnly": true, + "$ref": "#/components/schemas/InlinedResponses" } - } + }, + "type": "object" }, - "TuningExamples": { - "description": "A set of tuning examples. Can be training or validation data.", + "DynamicRetrievalConfig": { + "description": "Describes the options to customize dynamic retrieval.", "properties": { - "examples": { - "items": { - "$ref": "#/components/schemas/TuningExample" - }, - "type": "array", - "description": "The examples. Example input can be for text or discuss, but all examples in a set must be of the same type." + "mode": { + "description": "The mode of the predictor to be used in dynamic retrieval.", + "type": "string", + "x-enum-descriptions": [ + "Always trigger retrieval.", + "Run retrieval only when system decides it is necessary." + ], + "enum": [ + "MODE_UNSPECIFIED", + "MODE_DYNAMIC" + ] + }, + "dynamicThreshold": { + "description": "The threshold to be used in dynamic retrieval. If not set, a system default value is used.", + "format": "float", + "type": "number" } }, "type": "object" }, - "AttributionSourceId": { - "description": "Identifier for the source contributing to this attribution.", + "EmbedContentBatchStats": { + "type": "object", + "description": "Stats about the batch.", "properties": { - "semanticRetrieverChunk": { - "description": "Identifier for a `Chunk` fetched via Semantic Retriever.", - "$ref": "#/components/schemas/SemanticRetrieverChunk" + "pendingRequestCount": { + "readOnly": true, + "description": "Output only. The number of requests that are still pending processing.", + "format": "int64", + "type": "string" }, - "groundingPassage": { - "description": "Identifier for an inline passage.", - "$ref": "#/components/schemas/GroundingPassageId" + "successfulRequestCount": { + "type": "string", + "description": "Output only. The number of requests that were successfully processed.", + "format": "int64", + "readOnly": true + }, + "requestCount": { + "readOnly": true, + "description": "Output only. The number of requests in the batch.", + "format": "int64", + "type": "string" + }, + "failedRequestCount": { + "readOnly": true, + "description": "Output only. The number of requests that failed to be processed.", + "format": "int64", + "type": "string" } - }, - "type": "object" + } }, - "InlinedEmbedContentRequests": { + "ListFilesResponse": { "type": "object", - "description": "The requests to be processed in the batch if provided as part of the batch creation request.", + "description": "Response for `ListFiles`.", "properties": { - "requests": { + "files": { "type": "array", - "description": "Required. The requests to be processed in the batch.", "items": { - "$ref": "#/components/schemas/InlinedEmbedContentRequest" - } + "$ref": "#/components/schemas/File" + }, + "description": "The list of `File`s." + }, + "nextPageToken": { + "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.", + "type": "string" } } }, - "FunctionResponseBlob": { - "description": "Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.", + "UrlContext": { + "description": "Tool to support URL context retrieval.", + "properties": {}, + "type": "object" + }, + "MultiSpeakerVoiceConfig": { + "description": "The configuration for the multi-speaker setup.", "properties": { - "mimeType": { - "type": "string", - "description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats)." - }, - "data": { - "description": "Raw bytes for media formats.", - "type": "string", - "format": "byte" + "speakerVoiceConfigs": { + "type": "array", + "description": "Required. All the enabled speaker voices.", + "items": { + "$ref": "#/components/schemas/SpeakerVoiceConfig" + } } }, "type": "object" }, - "CodeExecutionResult": { + "EmbedContentRequest": { "type": "object", - "description": "Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.", + "description": "Request containing the `Content` for the model to embed.", "properties": { - "id": { - "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.", + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", "type": "string" }, - "outcome": { + "title": { + "deprecated": true, "type": "string", - "enum": [ - "OUTCOME_UNSPECIFIED", - "OUTCOME_OK", - "OUTCOME_FAILED", - "OUTCOME_DEADLINE_EXCEEDED" - ], - "description": "Required. Outcome of the code execution.", - "x-enum-descriptions": [ - "Unspecified status. This value should not be used.", - "Code execution completed successfully. `output` contains the stdout, if any.", - "Code execution failed. `output` contains the stderr and stdout, if any.", - "Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present." - ] + "description": "Optional. Deprecated: Please use EmbedContentConfig.title instead. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval." }, - "output": { - "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.", - "type": "string" - } - } - }, - "EmbedContentBatchOutput": { - "description": "The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.", - "properties": { - "inlinedResponses": { - "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", - "readOnly": true, - "$ref": "#/components/schemas/InlinedEmbedContentResponses" + "embedContentConfig": { + "$ref": "#/components/schemas/EmbedContentConfig", + "description": "Optional. Configuration for the EmbedContent request." + }, + "taskType": { + "type": "string", + "description": "Optional. Deprecated: Please use EmbedContentConfig.task_type instead. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`).", + "deprecated": true, + "x-enum-descriptions": [ + "Unset value, which will default to one of the other enum values.", + "Specifies the given text is a query in a search/retrieval setting.", + "Specifies the given text is a document from the corpus being searched.", + "Specifies the given text will be used for STS.", + "Specifies that the given text will be classified.", + "Specifies that the embeddings will be used for clustering.", + "Specifies that the given text will be used for question answering.", + "Specifies that the given text will be used for fact verification.", + "Specifies that the given text will be used for code retrieval." + ], + "enum": [ + "TASK_TYPE_UNSPECIFIED", + "RETRIEVAL_QUERY", + "RETRIEVAL_DOCUMENT", + "SEMANTIC_SIMILARITY", + "CLASSIFICATION", + "CLUSTERING", + "QUESTION_ANSWERING", + "FACT_VERIFICATION", + "CODE_RETRIEVAL_QUERY" + ] }, - "responsesFile": { - "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", - "readOnly": true, - "type": "string" - } - }, - "type": "object" - }, - "BatchEmbedContentsRequest": { - "type": "object", - "description": "Batch request to get embeddings from the model for a list of prompts.", - "properties": { - "requests": { - "type": "array", - "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.", - "items": { - "$ref": "#/components/schemas/EmbedContentRequest" - } + "outputDimensionality": { + "description": "Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`).", + "format": "int32", + "deprecated": true, + "type": "integer" + }, + "content": { + "description": "Required. The content to embed. Only the `parts.text` fields will be counted.", + "$ref": "#/components/schemas/Content" } } }, - "BatchStats": { - "description": "Stats about the batch.", + "EmbedContentBatch": { + "description": "A resource representing a batch of `EmbedContent` requests.", "properties": { - "requestCount": { + "batchStats": { + "description": "Output only. Stats about the batch.", "readOnly": true, + "$ref": "#/components/schemas/EmbedContentBatchStats" + }, + "displayName": { "type": "string", - "description": "Output only. The number of requests in the batch.", - "format": "int64" + "description": "Required. The user-defined name of this batch." }, - "successfulRequestCount": { - "readOnly": true, + "name": { "type": "string", - "description": "Output only. The number of requests that were successfully processed.", - "format": "int64" + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", + "readOnly": true }, - "failedRequestCount": { - "format": "int64", + "output": { "readOnly": true, + "$ref": "#/components/schemas/EmbedContentBatchOutput", + "description": "Output only. The output of the batch request." + }, + "model": { "type": "string", - "description": "Output only. The number of requests that failed to be processed." + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." }, - "pendingRequestCount": { + "inputConfig": { + "description": "Required. Input configuration of the instances on which batch processing are performed.", + "$ref": "#/components/schemas/InputEmbedContentConfig" + }, + "priority": { + "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", "format": "int64", - "description": "Output only. The number of requests that are still pending processing.", - "readOnly": true, "type": "string" - } - }, - "type": "object" - }, - "ToolConfig": { - "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", - "properties": { - "functionCallingConfig": { - "description": "Optional. Function calling config.", - "$ref": "#/components/schemas/FunctionCallingConfig" }, - "includeServerSideToolInvocations": { - "description": "Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions.", - "type": "boolean" + "createTime": { + "description": "Output only. The time at which the batch was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" }, - "retrievalConfig": { - "$ref": "#/components/schemas/RetrievalConfig", - "description": "Optional. Retrieval config." - } - }, - "type": "object" - }, - "VideoMetadata": { - "deprecated": true, - "description": "Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content.", - "properties": { - "endOffset": { - "format": "google-duration", + "endTime": { "type": "string", - "description": "Optional. The end offset of the video." + "readOnly": true, + "description": "Output only. The time at which the batch processing completed.", + "format": "google-datetime" }, - "startOffset": { - "format": "google-duration", - "description": "Optional. The start offset of the video.", + "updateTime": { + "readOnly": true, + "description": "Output only. The time at which the batch was last updated.", + "format": "google-datetime", "type": "string" }, - "fps": { - "format": "double", - "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].", - "type": "number" + "state": { + "readOnly": true, + "description": "Output only. The state of the batch.", + "type": "string", + "x-enum-descriptions": [ + "The batch state is unspecified.", + "The service is preparing to run the batch.", + "The batch is in progress.", + "The batch completed successfully.", + "The batch failed.", + "The batch has been cancelled.", + "The batch has expired." + ], + "enum": [ + "BATCH_STATE_UNSPECIFIED", + "BATCH_STATE_PENDING", + "BATCH_STATE_RUNNING", + "BATCH_STATE_SUCCEEDED", + "BATCH_STATE_FAILED", + "BATCH_STATE_CANCELLED", + "BATCH_STATE_EXPIRED" + ] } }, "type": "object" }, - "Web": { + "CitationMetadata": { "type": "object", - "description": "Chunk from the web.", + "description": "A collection of source attributions for a piece of content.", "properties": { - "uri": { - "description": "Output only. URI reference of the chunk.", - "readOnly": true, - "type": "string" - }, - "title": { - "description": "Output only. Title of the chunk.", - "readOnly": true, - "type": "string" + "citationSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CitationSource" + }, + "description": "Citations to sources for a specific response." } } }, - "MultiSpeakerVoiceConfig": { + "VoiceConfig": { "type": "object", - "description": "The configuration for the multi-speaker setup.", + "description": "The configuration for the voice to use.", "properties": { - "speakerVoiceConfigs": { - "items": { - "$ref": "#/components/schemas/SpeakerVoiceConfig" - }, - "description": "Required. All the enabled speaker voices.", - "type": "array" + "prebuiltVoiceConfig": { + "$ref": "#/components/schemas/PrebuiltVoiceConfig", + "description": "The configuration for the prebuilt voice to use." } } }, - "InlinedEmbedContentResponse": { - "description": "The response to a single request in the batch.", + "LogprobsResult": { + "type": "object", + "description": "Logprobs Result", "properties": { - "response": { - "readOnly": true, - "$ref": "#/components/schemas/EmbedContentResponse", - "description": "Output only. The response to the request." + "logProbabilitySum": { + "type": "number", + "description": "Sum of log probabilities for all tokens.", + "format": "float" }, - "error": { - "description": "Output only. The error encountered while processing the request.", - "readOnly": true, - "$ref": "#/components/schemas/Status" + "topCandidates": { + "description": "Length = total number of decoding steps.", + "items": { + "$ref": "#/components/schemas/TopCandidates" + }, + "type": "array" }, - "metadata": { - "readOnly": true, - "type": "object", - "description": "Output only. The metadata associated with the request.", - "additionalProperties": { - "description": "Properties of the object." - } + "chosenCandidates": { + "items": { + "$ref": "#/components/schemas/LogprobsResultCandidate" + }, + "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.", + "type": "array" } - }, - "type": "object" + } }, - "TuningTask": { - "description": "Tuning tasks that create tuned models.", + "StreamableHttpTransport": { + "description": "A transport that can stream HTTP requests and responses. Next ID: 6", "properties": { - "trainingData": { - "$ref": "#/components/schemas/Dataset", - "description": "Required. Input only. Immutable. The model training data." - }, - "hyperparameters": { - "$ref": "#/components/schemas/Hyperparameters", - "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used." + "timeout": { + "description": "HTTP timeout for regular operations.", + "format": "google-duration", + "type": "string" }, - "completeTime": { - "format": "google-datetime", - "readOnly": true, - "type": "string", - "description": "Output only. The timestamp when tuning this model completed." + "terminateOnClose": { + "description": "Whether to close the client session when the transport closes.", + "type": "boolean" }, - "startTime": { - "readOnly": true, + "url": { "type": "string", - "description": "Output only. The timestamp when tuning this model started.", - "format": "google-datetime" + "description": "The full URL for the MCPServer endpoint. Example: \"https://api.example.com/mcp\"" }, - "snapshots": { - "items": { - "$ref": "#/components/schemas/TuningSnapshot" + "headers": { + "description": "Optional: Fields for authentication headers, timeouts, etc., if needed.", + "additionalProperties": { + "type": "string" }, - "description": "Output only. Metrics collected during tuning.", - "readOnly": true, - "type": "array" + "type": "object" + }, + "sseReadTimeout": { + "type": "string", + "description": "Timeout for SSE read operations.", + "format": "google-duration" } }, "type": "object" }, - "ListTunedModelsResponse": { - "description": "Response from `ListTunedModels` containing a paginated list of Models.", + "InlinedRequest": { + "description": "The request to be processed in the batch.", "properties": { - "tunedModels": { - "type": "array", - "description": "The returned Models.", - "items": { - "$ref": "#/components/schemas/TunedModel" + "metadata": { + "type": "object", + "description": "Optional. The metadata to be associated with the request.", + "additionalProperties": { + "description": "Properties of the object." } }, - "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", - "type": "string" + "request": { + "$ref": "#/components/schemas/GenerateContentRequest", + "description": "Required. The request to be processed in the batch." } }, "type": "object"