-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add conversational search (#7734)
feat: add tile navigation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 683821686 Source-Link: googleapis/googleapis@d01eb46 Source-Link: googleapis/googleapis-gen@1db3459 Copy-Tag: eyJwIjoiUmV0YWlsLy5Pd2xCb3QueWFtbCIsImgiOiIxZGIzNDU5ZjNkZmE5MzQ3YTU4MTFkNzJiMTJlMTcxNGRhNzVlZDkzIn0=
- Loading branch information
1 parent
dd48f72
commit 7c553c2
Showing
42 changed files
with
4,623 additions
and
24 deletions.
There are no files selected for viewing
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.
Binary file not shown.
86 changes: 86 additions & 0 deletions
86
...l/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.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,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 retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsRequest; | ||
use Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsResponse; | ||
use Google\Cloud\Retail\V2\Client\GenerativeQuestionServiceClient; | ||
use Google\Cloud\Retail\V2\GenerativeQuestionConfig; | ||
use Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest; | ||
|
||
/** | ||
* Allows management of multiple questions. | ||
* | ||
* @param string $requestsGenerativeQuestionConfigCatalog Resource name of the catalog. | ||
* Format: projects/{project}/locations/{location}/catalogs/{catalog} | ||
* @param string $requestsGenerativeQuestionConfigFacet The facet to which the question is associated. | ||
*/ | ||
function batch_update_generative_question_configs_sample( | ||
string $requestsGenerativeQuestionConfigCatalog, | ||
string $requestsGenerativeQuestionConfigFacet | ||
): void { | ||
// Create a client. | ||
$generativeQuestionServiceClient = new GenerativeQuestionServiceClient(); | ||
|
||
// Prepare the request message. | ||
$requestsGenerativeQuestionConfig = (new GenerativeQuestionConfig()) | ||
->setCatalog($requestsGenerativeQuestionConfigCatalog) | ||
->setFacet($requestsGenerativeQuestionConfigFacet); | ||
$updateGenerativeQuestionConfigRequest = (new UpdateGenerativeQuestionConfigRequest()) | ||
->setGenerativeQuestionConfig($requestsGenerativeQuestionConfig); | ||
$requests = [$updateGenerativeQuestionConfigRequest,]; | ||
$request = (new BatchUpdateGenerativeQuestionConfigsRequest()) | ||
->setRequests($requests); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var BatchUpdateGenerativeQuestionConfigsResponse $response */ | ||
$response = $generativeQuestionServiceClient->batchUpdateGenerativeQuestionConfigs($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 | ||
{ | ||
$requestsGenerativeQuestionConfigCatalog = '[CATALOG]'; | ||
$requestsGenerativeQuestionConfigFacet = '[FACET]'; | ||
|
||
batch_update_generative_question_configs_sample( | ||
$requestsGenerativeQuestionConfigCatalog, | ||
$requestsGenerativeQuestionConfigFacet | ||
); | ||
} | ||
// [END retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] |
77 changes: 77 additions & 0 deletions
77
...il/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.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,77 @@ | ||
<?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 retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\Retail\V2\Client\GenerativeQuestionServiceClient; | ||
use Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig; | ||
use Google\Cloud\Retail\V2\GetGenerativeQuestionsFeatureConfigRequest; | ||
|
||
/** | ||
* Manages overal generative question feature state -- enables toggling | ||
* feature on and off. | ||
* | ||
* @param string $formattedCatalog Resource name of the parent catalog. | ||
* Format: projects/{project}/locations/{location}/catalogs/{catalog} | ||
* Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. | ||
*/ | ||
function get_generative_questions_feature_config_sample(string $formattedCatalog): void | ||
{ | ||
// Create a client. | ||
$generativeQuestionServiceClient = new GenerativeQuestionServiceClient(); | ||
|
||
// Prepare the request message. | ||
$request = (new GetGenerativeQuestionsFeatureConfigRequest()) | ||
->setCatalog($formattedCatalog); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var GenerativeQuestionsFeatureConfig $response */ | ||
$response = $generativeQuestionServiceClient->getGenerativeQuestionsFeatureConfig($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 | ||
{ | ||
$formattedCatalog = GenerativeQuestionServiceClient::catalogName( | ||
'[PROJECT]', | ||
'[LOCATION]', | ||
'[CATALOG]' | ||
); | ||
|
||
get_generative_questions_feature_config_sample($formattedCatalog); | ||
} | ||
// [END retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] |
76 changes: 76 additions & 0 deletions
76
Retail/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.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,76 @@ | ||
<?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 retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\Retail\V2\Client\GenerativeQuestionServiceClient; | ||
use Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsRequest; | ||
use Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsResponse; | ||
|
||
/** | ||
* Returns all questions for a given catalog. | ||
* | ||
* @param string $formattedParent Resource name of the parent catalog. | ||
* Format: projects/{project}/locations/{location}/catalogs/{catalog} | ||
* Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. | ||
*/ | ||
function list_generative_question_configs_sample(string $formattedParent): void | ||
{ | ||
// Create a client. | ||
$generativeQuestionServiceClient = new GenerativeQuestionServiceClient(); | ||
|
||
// Prepare the request message. | ||
$request = (new ListGenerativeQuestionConfigsRequest()) | ||
->setParent($formattedParent); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var ListGenerativeQuestionConfigsResponse $response */ | ||
$response = $generativeQuestionServiceClient->listGenerativeQuestionConfigs($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 | ||
{ | ||
$formattedParent = GenerativeQuestionServiceClient::catalogName( | ||
'[PROJECT]', | ||
'[LOCATION]', | ||
'[CATALOG]' | ||
); | ||
|
||
list_generative_question_configs_sample($formattedParent); | ||
} | ||
// [END retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] |
Oops, something went wrong.