Skip to content

Commit

Permalink
fix: location type annotation (#7739)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 684535402
Source-Link: googleapis/googleapis@d544df7
Source-Link: googleapis/googleapis-gen@8bdbcef
Copy-Tag: eyJwIjoiRGlzY292ZXJ5RW5naW5lLy5Pd2xCb3QueWFtbCIsImgiOiI4YmRiY2VmODUxMDczZjQ5Y2Y5NmU0NTg2NGM0ZWFkYjM3Y2Q3ZDY5In0=

feat: Add GroundedGenerationService API
feat: Add BillingEstimation in data store
feat: Support Google Workspace search
feat: Support advanced boost search
feat: Add one_box_page_size on search
feat: Add site_credential for site search config
docs: Update documentation
PiperOrigin-RevId: 684224724
Source-Link: googleapis/googleapis@72be138
Source-Link: googleapis/googleapis-gen@eecf784
Copy-Tag: eyJwIjoiRGlzY292ZXJ5RW5naW5lLy5Pd2xCb3QueWFtbCIsImgiOiJlZWNmNzg0YjAyMGZkYWM1ZTc1ODg0ZmQzNjM0YjFhYTQwMDIyYWNhIn0=
  • Loading branch information
gcf-owl-bot[bot] authored Oct 11, 2024
1 parent 3252d24 commit a93ec74
Show file tree
Hide file tree
Showing 122 changed files with 5,664 additions and 192 deletions.
Binary file modified DiscoveryEngine/metadata/V1/Answer.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/Common.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/ConversationalSearchService.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/CustomTuningModel.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/DataStore.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/DocumentService.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/Engine.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/GroundedGenerationService.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/SearchService.php
Binary file not shown.
Binary file modified DiscoveryEngine/metadata/V1/SiteSearchEngineService.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
* exists, an ALREADY_EXISTS error is returned.
*
* @param string $formattedParent Full resource name of parent data store. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}`
* `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`
* or
* `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see
* `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. Please see
* {@see ControlServiceClient::dataStoreName()} for help formatting this field.
* @param string $controlDisplayName Human readable name. The identifier used in UI views.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* not exist, a NOT_FOUND error is returned.
*
* @param string $formattedName The resource name of the Control to delete. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}`
* `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}`
* Please see {@see ControlServiceClient::controlName()} for help formatting this field.
*/
function delete_control_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Gets a Control.
*
* @param string $formattedName The resource name of the Control to get. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}`
* `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}`
* Please see {@see ControlServiceClient::controlName()} for help formatting this field.
*/
function get_control_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
* [DataStore][google.cloud.discoveryengine.v1.DataStore].
*
* @param string $formattedParent The data store resource name. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}`
* `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`
* or
* `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see
* `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. Please see
* {@see ControlServiceClient::dataStoreName()} for help formatting this field.
*/
function list_controls_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
* Converses a conversation.
*
* @param string $formattedName The resource name of the Conversation to get. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
* Use
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
* to activate auto session mode, which automatically creates a new
* conversation inside a ConverseConversation session. Please see
* {@see ConversationalSearchServiceClient::conversationName()} for help formatting this field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* create already exists, an ALREADY_EXISTS error is returned.
*
* @param string $formattedParent Full resource name of parent data store. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
* Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field.
*/
function create_conversation_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* exists, an ALREADY_EXISTS error is returned.
*
* @param string $formattedParent Full resource name of parent data store. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
* Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field.
*/
function create_session_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* delete does not exist, a NOT_FOUND error is returned.
*
* @param string $formattedName The resource name of the Conversation to delete. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
* Please see {@see ConversationalSearchServiceClient::conversationName()} for help formatting this field.
*/
function delete_conversation_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* not exist, a NOT_FOUND error is returned.
*
* @param string $formattedName The resource name of the Session to delete. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
* Please see {@see ConversationalSearchServiceClient::sessionName()} for help formatting this field.
*/
function delete_session_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Gets a Answer.
*
* @param string $formattedName The resource name of the Answer to get. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
* `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
* Please see {@see ConversationalSearchServiceClient::answerName()} for help formatting this field.
*/
function get_answer_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Gets a Conversation.
*
* @param string $formattedName The resource name of the Conversation to get. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
* Please see {@see ConversationalSearchServiceClient::conversationName()} for help formatting this field.
*/
function get_conversation_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Gets a Session.
*
* @param string $formattedName The resource name of the Session to get. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
* Please see {@see ConversationalSearchServiceClient::sessionName()} for help formatting this field.
*/
function get_session_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* [DataStore][google.cloud.discoveryengine.v1.DataStore].
*
* @param string $formattedParent The data store resource name. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
* Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field.
*/
function list_conversations_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* [DataStore][google.cloud.discoveryengine.v1.DataStore].
*
* @param string $formattedParent The data store resource name. Format:
* `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
* Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field.
*/
function list_sessions_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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 discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\DiscoveryEngine\V1\Client\GroundedGenerationServiceClient;
use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest;
use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse;

/**
* Generates grounded content.
*
* @param string $formattedLocation Location resource.
*
* Format: `projects/{project}/locations/{location}`. Please see
* {@see GroundedGenerationServiceClient::locationName()} for help formatting this field.
*/
function generate_grounded_content_sample(string $formattedLocation): void
{
// Create a client.
$groundedGenerationServiceClient = new GroundedGenerationServiceClient();

// Prepare the request message.
$request = (new GenerateGroundedContentRequest())
->setLocation($formattedLocation);

// Call the API and handle any network failures.
try {
/** @var GenerateGroundedContentResponse $response */
$response = $groundedGenerationServiceClient->generateGroundedContent($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
{
$formattedLocation = GroundedGenerationServiceClient::locationName('[PROJECT]', '[LOCATION]');

generate_grounded_content_sample($formattedLocation);
}
// [END discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?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 discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\BidiStream;
use Google\Cloud\DiscoveryEngine\V1\Client\GroundedGenerationServiceClient;
use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest;
use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse;

/**
* Generates grounded content in a streaming fashion.
*
* @param string $formattedLocation Location resource.
*
* Format: `projects/{project}/locations/{location}`. Please see
* {@see GroundedGenerationServiceClient::locationName()} for help formatting this field.
*/
function stream_generate_grounded_content_sample(string $formattedLocation): void
{
// Create a client.
$groundedGenerationServiceClient = new GroundedGenerationServiceClient();

// Prepare the request message.
$request = (new GenerateGroundedContentRequest())
->setLocation($formattedLocation);

// Call the API and handle any network failures.
try {
/** @var BidiStream $stream */
$stream = $groundedGenerationServiceClient->streamGenerateGroundedContent();
$stream->writeAll([$request,]);

/** @var GenerateGroundedContentResponse $element */
foreach ($stream->closeWriteAndReadAll() 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
{
$formattedLocation = GroundedGenerationServiceClient::locationName('[PROJECT]', '[LOCATION]');

stream_generate_grounded_content_sample($formattedLocation);
}
// [END discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync]
2 changes: 1 addition & 1 deletion DiscoveryEngine/samples/V1/RankServiceClient/rank.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Ranks a list of text records based on the given input query.
*
* @param string $formattedRankingConfig The resource name of the rank service config, such as
* `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. Please see
* `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. Please see
* {@see RankServiceClient::rankingConfigName()} for help formatting this field.
*/
function rank_sample(string $formattedRankingConfig): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
*
* @param string $formattedParent The resource name of the catalog under which the events are
* created. The format is
* `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`
* Please see {@see UserEventServiceClient::dataStoreName()} for help formatting this field.
* `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. Please see
* {@see UserEventServiceClient::dataStoreName()} for help formatting this field.
* @param string $filter The filter string to specify the events to be deleted with a
* length limit of 5,000 characters. The eligible fields for filtering are:
*
Expand Down
11 changes: 10 additions & 1 deletion DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php

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

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

Loading

0 comments on commit a93ec74

Please sign in to comment.