Skip to content

Commit

Permalink
feat: A new field score is added to message `.google.cloud.aiplatfo…
Browse files Browse the repository at this point in the history
…rm.v1.Candidate` (#7557)

feat: A new message `Segment` is added
feat: A new message `GroundingChunk` is added
feat: A new message `GroundingSupport` is added
feat: A new field `grounding_chunks` is added to message `.google.cloud.aiplatform.v1.GroundingMetadata`
feat: A new field `grounding_supports` is added to message `.google.cloud.aiplatform.v1.GroundingMetadata`
feat: A new enum `Strategy` is added
feat: A new field `strategy` is added to message `.google.cloud.aiplatform.v1.Scheduling`
feat: A new field `dedicated_endpoint_enabled` is added to message `.google.cloud.aiplatform.v1.Endpoint`
feat: A new field `dedicated_endpoint_dns` is added to message `.google.cloud.aiplatform.v1.Endpoint`
feat: A new field `satisfies_pzs` is added to message `.google.cloud.aiplatform.v1.Endpoint`
feat: A new field `satisfies_pzi` is added to message `.google.cloud.aiplatform.v1.Endpoint`
feat: A new message `NumericFilter` is added
feat: A new field `numeric_filters` is added to message `.google.cloud.aiplatform.v1.NearestNeighborQuery`
feat: A new field `is_hugging_face_model` is added to message `.google.cloud.aiplatform.v1.GetPublisherModelRequest`
feat: A new message `NotebookExecutionJob` is added
feat: A new resource_definition `aiplatform.googleapis.com/NotebookExecutionJob` is added
feat: A new method `CreateNotebookExecutionJob` is added to service `NotebookService`
feat: A new method `GetNotebookExecutionJob` is added to service `NotebookService`
feat: A new method `ListNotebookExecutionJobs` is added to service `NotebookService`
feat: A new method `DeleteNotebookExecutionJob` is added to service `NotebookService`
feat: A new enum `NotebookExecutionJobView` is added
feat: A new message `CreateNotebookExecutionJobRequest` is added
feat: A new message `CreateNotebookExecutionJobOperationMetadata` is added
feat: A new message `GetNotebookExecutionJobRequest` is added
feat: A new message `ListNotebookExecutionJobsRequest` is added
feat: A new message `ListNotebookExecutionJobsResponse` is added
feat: A new message `DeleteNotebookExecutionJobRequest` is added
feat: A new field `ray_logs_spec` is added to message `.google.cloud.aiplatform.v1.RaySpec`
feat: A new message `RayLogsSpec` is added
feat: A new field `system_instruction` is added to message `.google.cloud.aiplatform.v1.CountTokensRequest`
feat: A new field `tools` is added to message `.google.cloud.aiplatform.v1.CountTokensRequest`
feat: A new field `billable_sum` is added to message `.google.cloud.aiplatform.v1.SupervisedTuningDatasetDistribution`
feat: A new field `total_billable_token_count` is added to message `.google.cloud.aiplatform.v1.SupervisedTuningDataStats`
feat: A new value `ADAPTER_SIZE_THIRTY_TWO` is added to enum `AdapterSize`
docs: A comment for field `name` in message `.google.cloud.aiplatform.v1.Dataset` is changed
docs: A comment for field `name` in message `.google.cloud.aiplatform.v1.DatasetVersion` is changed
docs: A comment for field `update_mask` in message `.google.cloud.aiplatform.v1.UpdateFeatureOnlineStoreRequest` is changed
docs: A comment for field `update_mask` in message `.google.cloud.aiplatform.v1.UpdateFeatureViewRequest` is changed
docs: A comment for field `update_mask` in message `.google.cloud.aiplatform.v1.UpdateFeatureGroupRequest` is changed
docs: A comment for field `update_mask` in message `.google.cloud.aiplatform.v1.UpdateFeatureRequest` is changed
docs: A comment for field `language_code` in message `.google.cloud.aiplatform.v1.GetPublisherModelRequest` is changed
docs: A comment for field `model` in message `.google.cloud.aiplatform.v1.CountTokensRequest` is changed
docs: A comment for field `instances` in message `.google.cloud.aiplatform.v1.CountTokensRequest` is changed
docs: A comment for field `contents` in message `.google.cloud.aiplatform.v1.CountTokensRequest` is changed
docs: A comment for message `TrialContext` is changed
docs: A comment for field `disable_attribution` in message `.google.cloud.aiplatform.v1.Retrieval` is changed
PiperOrigin-RevId: 656538560
Source-Link: googleapis/googleapis@0fa9ce8
Source-Link: googleapis/googleapis-gen@5c99c52
Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiNWM5OWM1MjczNmU0OTA1NjEyZWNhNjU1YTY5Yzc0NjQyNzc5ZWM5YSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Jul 30, 2024
1 parent d868a50 commit c31f326
Show file tree
Hide file tree
Showing 66 changed files with 4,973 additions and 130 deletions.
Binary file modified AiPlatform/metadata/V1/AcceleratorType.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/Content.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/CustomJob.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/Dataset.php
Binary file not shown.
8 changes: 4 additions & 4 deletions AiPlatform/metadata/V1/DatasetVersion.php

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

Binary file modified AiPlatform/metadata/V1/Endpoint.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/FeatureOnlineStoreService.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/ModelGardenService.php
Binary file not shown.
Binary file added AiPlatform/metadata/V1/NotebookExecutionJob.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/NotebookService.php
Binary file not shown.
Binary file modified AiPlatform/metadata/V1/PersistentResource.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.
Binary file modified AiPlatform/metadata/V1/TuningJob.php
Binary file not shown.
21 changes: 3 additions & 18 deletions AiPlatform/samples/V1/LlmUtilityServiceClient/count_tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
// [START aiplatform_v1_generated_LlmUtilityService_CountTokens_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\LlmUtilityServiceClient;
use Google\Cloud\AIPlatform\V1\Content;
use Google\Cloud\AIPlatform\V1\CountTokensRequest;
use Google\Cloud\AIPlatform\V1\CountTokensResponse;
use Google\Cloud\AIPlatform\V1\Part;
use Google\Protobuf\Value;

/**
* Perform a token counting.
Expand All @@ -38,26 +35,15 @@
* Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* Please see {@see LlmUtilityServiceClient::endpointName()} for help formatting this field.
* @param string $model The name of the publisher model requested to serve the
* prediction. Format:
* `projects/{project}/locations/{location}/publishers/*/models/*`
*/
function count_tokens_sample(string $formattedEndpoint, string $model): void
function count_tokens_sample(string $formattedEndpoint): void
{
// Create a client.
$llmUtilityServiceClient = new LlmUtilityServiceClient();

// Prepare the request message.
$instances = [new Value()];
$contentsParts = [new Part()];
$content = (new Content())
->setParts($contentsParts);
$contents = [$content,];
$request = (new CountTokensRequest())
->setEndpoint($formattedEndpoint)
->setModel($model)
->setInstances($instances)
->setContents($contents);
->setEndpoint($formattedEndpoint);

// Call the API and handle any network failures.
try {
Expand All @@ -81,8 +67,7 @@ function count_tokens_sample(string $formattedEndpoint, string $model): void
function callSample(): void
{
$formattedEndpoint = LlmUtilityServiceClient::endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]');
$model = '[MODEL]';

count_tokens_sample($formattedEndpoint, $model);
count_tokens_sample($formattedEndpoint);
}
// [END aiplatform_v1_generated_LlmUtilityService_CountTokens_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php
/*
* Copyright 2024 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_NotebookService_CreateNotebookExecutionJob_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\NotebookServiceClient;
use Google\Cloud\AIPlatform\V1\CreateNotebookExecutionJobRequest;
use Google\Cloud\AIPlatform\V1\NotebookExecutionJob;
use Google\Rpc\Status;

/**
* Creates a NotebookExecutionJob.
*
* @param string $formattedParent The resource name of the Location to create the
* NotebookExecutionJob. Format: `projects/{project}/locations/{location}`
* Please see {@see NotebookServiceClient::locationName()} for help formatting this field.
*/
function create_notebook_execution_job_sample(string $formattedParent): void
{
// Create a client.
$notebookServiceClient = new NotebookServiceClient();

// Prepare the request message.
$notebookExecutionJob = new NotebookExecutionJob();
$request = (new CreateNotebookExecutionJobRequest())
->setParent($formattedParent)
->setNotebookExecutionJob($notebookExecutionJob);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $notebookServiceClient->createNotebookExecutionJob($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
/** @var NotebookExecutionJob $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->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
{
$formattedParent = NotebookServiceClient::locationName('[PROJECT]', '[LOCATION]');

create_notebook_execution_job_sample($formattedParent);
}
// [END aiplatform_v1_generated_NotebookService_CreateNotebookExecutionJob_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/*
* Copyright 2024 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_NotebookService_DeleteNotebookExecutionJob_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\NotebookServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteNotebookExecutionJobRequest;
use Google\Rpc\Status;

/**
* Deletes a NotebookExecutionJob.
*
* @param string $formattedName The name of the NotebookExecutionJob resource to be deleted. Please see
* {@see NotebookServiceClient::notebookExecutionJobName()} for help formatting this field.
*/
function delete_notebook_execution_job_sample(string $formattedName): void
{
// Create a client.
$notebookServiceClient = new NotebookServiceClient();

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

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $notebookServiceClient->deleteNotebookExecutionJob($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NotebookServiceClient::notebookExecutionJobName(
'[PROJECT]',
'[LOCATION]',
'[NOTEBOOK_EXECUTION_JOB]'
);

delete_notebook_execution_job_sample($formattedName);
}
// [END aiplatform_v1_generated_NotebookService_DeleteNotebookExecutionJob_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php
/*
* Copyright 2024 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_NotebookService_GetNotebookExecutionJob_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\NotebookServiceClient;
use Google\Cloud\AIPlatform\V1\GetNotebookExecutionJobRequest;
use Google\Cloud\AIPlatform\V1\NotebookExecutionJob;

/**
* Gets a NotebookExecutionJob.
*
* @param string $formattedName The name of the NotebookExecutionJob resource. Please see
* {@see NotebookServiceClient::notebookExecutionJobName()} for help formatting this field.
*/
function get_notebook_execution_job_sample(string $formattedName): void
{
// Create a client.
$notebookServiceClient = new NotebookServiceClient();

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

// Call the API and handle any network failures.
try {
/** @var NotebookExecutionJob $response */
$response = $notebookServiceClient->getNotebookExecutionJob($request);
printf('Response data: %s' . PHP_EOL, $response->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 = NotebookServiceClient::notebookExecutionJobName(
'[PROJECT]',
'[LOCATION]',
'[NOTEBOOK_EXECUTION_JOB]'
);

get_notebook_execution_job_sample($formattedName);
}
// [END aiplatform_v1_generated_NotebookService_GetNotebookExecutionJob_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php
/*
* Copyright 2024 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_NotebookService_ListNotebookExecutionJobs_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\NotebookServiceClient;
use Google\Cloud\AIPlatform\V1\ListNotebookExecutionJobsRequest;
use Google\Cloud\AIPlatform\V1\NotebookExecutionJob;

/**
* Lists NotebookExecutionJobs in a Location.
*
* @param string $formattedParent The resource name of the Location from which to list the
* NotebookExecutionJobs.
* Format: `projects/{project}/locations/{location}`
* Please see {@see NotebookServiceClient::locationName()} for help formatting this field.
*/
function list_notebook_execution_jobs_sample(string $formattedParent): void
{
// Create a client.
$notebookServiceClient = new NotebookServiceClient();

// Prepare the request message.
$request = (new ListNotebookExecutionJobsRequest())
->setParent($formattedParent);

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

/** @var NotebookExecutionJob $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
{
$formattedParent = NotebookServiceClient::locationName('[PROJECT]', '[LOCATION]');

list_notebook_execution_jobs_sample($formattedParent);
}
// [END aiplatform_v1_generated_NotebookService_ListNotebookExecutionJobs_sync]
Loading

0 comments on commit c31f326

Please sign in to comment.