Skip to content

Commit

Permalink
feat: add optimized config in v1 API (#8048)
Browse files Browse the repository at this point in the history
* feat: add per-modality token count break downs for GenAI APIs
PiperOrigin-RevId: 719367305
Source-Link: googleapis/googleapis@8c62e01
Source-Link: googleapis/googleapis-gen@46aa0d1
Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiNDZhYTBkMWQyMjgwNTY2MTA5MDg2ZDVhOTNhN2U1YTJjYzg5NTBkMCJ9

* feat: enable FeatureView Service Account in v1 API version
PiperOrigin-RevId: 719390405
Source-Link: googleapis/googleapis@1db12e6
Source-Link: googleapis/googleapis-gen@66be99f
Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiNjZiZTk5ZmZmNmUwNWM5OTYzOWE0MGMzNjFiZWI5ODIxMzY0MDIzZCJ9

* feat: Expose code execution tool API to v1
PiperOrigin-RevId: 719423496
Source-Link: googleapis/googleapis@d8b31b6
Source-Link: googleapis/googleapis-gen@8a130cd
Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiOGExMzBjZDgzNzc2MTIyMmY0NTBhYTgwM2E0M2UxOWY2NTVlMGNmNiJ9

* feat: Model Registry Checkpoint API
PiperOrigin-RevId: 720329155
Source-Link: googleapis/googleapis@446b65c
Source-Link: googleapis/googleapis-gen@ffa8f1e
Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiZmZhOGYxZTNiY2M5YjdlOTVjYTBmMjg5YzgxMWRiNGU2NDA5ZmU4NiJ9

* feat: add optimized config in v1 API
docs: Update comments for NumericFilter and Operator
PiperOrigin-RevId: 720346137
Source-Link: googleapis/googleapis@27aa9d5
Source-Link: googleapis/googleapis-gen@8f2c9bf
Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiOGYyYzliZmE3MjRkNzY4MjdkYjI4MjQwNzFmNWI0YmVlZjlkZTJmMSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Jan 29, 2025
1 parent fce46dc commit e3b9130
Show file tree
Hide file tree
Showing 65 changed files with 2,776 additions and 6 deletions.
Binary file modified AiPlatform/metadata/V1/Content.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/FeatureView.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/Model.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/ModelService.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/PredictionService.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/Tool.php
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START aiplatform_v1_generated_ModelService_ListModelVersionCheckpoints_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\ModelServiceClient;
use Google\Cloud\AIPlatform\V1\ListModelVersionCheckpointsRequest;
use Google\Cloud\AIPlatform\V1\ModelVersionCheckpoint;

/**
* Lists checkpoints of the specified model version.
*
* @param string $formattedName The name of the model version to list checkpoints for.
* `projects/{project}/locations/{location}/models/{model}&#64;{version}`
* Example: `projects/{project}/locations/{location}/models/{model}&#64;2`
* or
* `projects/{project}/locations/{location}/models/{model}&#64;golden`
* If no version ID or alias is specified, the latest version will be
* used. Please see
* {@see ModelServiceClient::modelName()} for help formatting this field.
*/
function list_model_version_checkpoints_sample(string $formattedName): void
{
// Create a client.
$modelServiceClient = new ModelServiceClient();

// Prepare the request message.
$request = (new ListModelVersionCheckpointsRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $modelServiceClient->listModelVersionCheckpoints($request);

/** @var ModelVersionCheckpoint $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = ModelServiceClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]');

list_model_version_checkpoints_sample($formattedName);
}
// [END aiplatform_v1_generated_ModelService_ListModelVersionCheckpoints_sync]
31 changes: 31 additions & 0 deletions AiPlatform/src/V1/Client/ModelServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use Google\Cloud\AIPlatform\V1\ImportModelEvaluationRequest;
use Google\Cloud\AIPlatform\V1\ListModelEvaluationSlicesRequest;
use Google\Cloud\AIPlatform\V1\ListModelEvaluationsRequest;
use Google\Cloud\AIPlatform\V1\ListModelVersionCheckpointsRequest;
use Google\Cloud\AIPlatform\V1\ListModelVersionsRequest;
use Google\Cloud\AIPlatform\V1\ListModelsRequest;
use Google\Cloud\AIPlatform\V1\MergeVersionAliasesRequest;
Expand Down Expand Up @@ -93,6 +94,7 @@
* @method PromiseInterface<ModelEvaluation> importModelEvaluationAsync(ImportModelEvaluationRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listModelEvaluationSlicesAsync(ListModelEvaluationSlicesRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listModelEvaluationsAsync(ListModelEvaluationsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listModelVersionCheckpointsAsync(ListModelVersionCheckpointsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listModelVersionsAsync(ListModelVersionsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listModelsAsync(ListModelsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<Model> mergeVersionAliasesAsync(MergeVersionAliasesRequest $request, array $optionalArgs = [])
Expand Down Expand Up @@ -854,6 +856,35 @@ public function listModelEvaluations(
return $this->startApiCall('ListModelEvaluations', $request, $callOptions);
}

/**
* Lists checkpoints of the specified model version.
*
* The async variant is
* {@see ModelServiceClient::listModelVersionCheckpointsAsync()} .
*
* @example samples/V1/ModelServiceClient/list_model_version_checkpoints.php
*
* @param ListModelVersionCheckpointsRequest $request A request to house fields associated with the call.
* @param array $callOptions {
* Optional.
*
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return PagedListResponse
*
* @throws ApiException Thrown if the API call fails.
*/
public function listModelVersionCheckpoints(
ListModelVersionCheckpointsRequest $request,
array $callOptions = []
): PagedListResponse {
return $this->startApiCall('ListModelVersionCheckpoints', $request, $callOptions);
}

/**
* Lists versions of the specified model.
*
Expand Down
106 changes: 106 additions & 0 deletions AiPlatform/src/V1/CodeExecutionResult.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions AiPlatform/src/V1/CodeExecutionResult/Outcome.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions AiPlatform/src/V1/CountTokensResponse.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e3b9130

Please sign in to comment.