-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add optimized config in v1 API (#8048)
* 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
1 parent
fce46dc
commit e3b9130
Showing
65 changed files
with
2,776 additions
and
6 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
82 changes: 82 additions & 0 deletions
82
AiPlatform/samples/V1/ModelServiceClient/list_model_version_checkpoints.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}@{version}` | ||
* Example: `projects/{project}/locations/{location}/models/{model}@2` | ||
* or | ||
* `projects/{project}/locations/{location}/models/{model}@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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.