Skip to content

Commit ee62764

Browse files
feat: [AiPlatform] Add asyncQueryReasoningEngine to aiplatform v1 API (#9106)
* feat: Model Registry CopyModel BYOSA PiperOrigin-RevId: 899215526 Source-Link: googleapis/googleapis@62e4ecb Source-Link: googleapis/googleapis-gen@1363385 Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiMTM2MzM4NWY0N2M0ZTBhM2Y1NGMxYzkzYWYzZDA5ZThmYTUxOGQwYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add asyncQueryReasoningEngine to aiplatform v1 API PiperOrigin-RevId: 900907134 Source-Link: googleapis/googleapis@1a00cec Source-Link: googleapis/googleapis-gen@f356560 Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiZjM1NjU2MDY5Y2M4MGRiZTMyZmUzNmE2NjAzZTUxNTYyY2ViYTJjNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 53c170d commit ee62764

13 files changed

Lines changed: 768 additions & 15 deletions

AiPlatform/metadata/V1/ModelService.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AiPlatform/metadata/V1/ReasoningEngineExecutionService.php

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\AIPlatform\V1\AsyncQueryReasoningEngineRequest;
29+
use Google\Cloud\AIPlatform\V1\AsyncQueryReasoningEngineResponse;
30+
use Google\Cloud\AIPlatform\V1\Client\ReasoningEngineExecutionServiceClient;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Async query using a reasoning engine.
35+
*
36+
* @param string $formattedName The name of the ReasoningEngine resource to use.
37+
* Format:
38+
* `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
39+
* Please see {@see ReasoningEngineExecutionServiceClient::reasoningEngineName()} for help formatting this field.
40+
*/
41+
function async_query_reasoning_engine_sample(string $formattedName): void
42+
{
43+
// Create a client.
44+
$reasoningEngineExecutionServiceClient = new ReasoningEngineExecutionServiceClient();
45+
46+
// Prepare the request message.
47+
$request = (new AsyncQueryReasoningEngineRequest())
48+
->setName($formattedName);
49+
50+
// Call the API and handle any network failures.
51+
try {
52+
/** @var OperationResponse $response */
53+
$response = $reasoningEngineExecutionServiceClient->asyncQueryReasoningEngine($request);
54+
$response->pollUntilComplete();
55+
56+
if ($response->operationSucceeded()) {
57+
/** @var AsyncQueryReasoningEngineResponse $result */
58+
$result = $response->getResult();
59+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
60+
} else {
61+
/** @var Status $error */
62+
$error = $response->getError();
63+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
64+
}
65+
} catch (ApiException $ex) {
66+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
67+
}
68+
}
69+
70+
/**
71+
* Helper to execute the sample.
72+
*
73+
* This sample has been automatically generated and should be regarded as a code
74+
* template only. It will require modifications to work:
75+
* - It may require correct/in-range values for request initialization.
76+
* - It may require specifying regional endpoints when creating the service client,
77+
* please see the apiEndpoint client configuration option for more details.
78+
*/
79+
function callSample(): void
80+
{
81+
$formattedName = ReasoningEngineExecutionServiceClient::reasoningEngineName(
82+
'[PROJECT]',
83+
'[LOCATION]',
84+
'[REASONING_ENGINE]'
85+
);
86+
87+
async_query_reasoning_engine_sample($formattedName);
88+
}
89+
// [END aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync]

AiPlatform/src/V1/AsyncQueryReasoningEngineOperationMetadata.php

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AiPlatform/src/V1/AsyncQueryReasoningEngineRequest.php

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AiPlatform/src/V1/AsyncQueryReasoningEngineResponse.php

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)