-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support boost in multi-turn search feat: add document processing config services feat: add search tuning services feat: allow setting schema on schema creation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 614046598 Source-Link: googleapis/googleapis@d66613f Source-Link: googleapis/googleapis-gen@3d65645 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRGlzY292ZXJ5RW5naW5lLlYxQmV0YS8uT3dsQm90LnlhbWwiLCJoIjoiM2Q2NTY0NTBkM2E2NzZjZWFiNzA3OGM2NzNmMmUwNTI0M2UwMWQ4ZiJ9
- Loading branch information
1 parent
3f92c8d
commit a2187da
Showing
38 changed files
with
5,184 additions
and
425 deletions.
There are no files selected for viewing
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
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
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
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
67 changes: 67 additions & 0 deletions
67
...eneratedSnippets/SearchTuningServiceClient.TrainCustomModelRequestObjectAsyncSnippet.g.cs
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,67 @@ | ||
// 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. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START discoveryengine_v1beta_generated_SearchTuningService_TrainCustomModel_async] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedSearchTuningServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for TrainCustomModelAsync</summary> | ||
/// <remarks> | ||
/// This snippet 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 as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task TrainCustomModelRequestObjectAsync() | ||
{ | ||
// Create client | ||
SearchTuningServiceClient searchTuningServiceClient = await SearchTuningServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
TrainCustomModelRequest request = new TrainCustomModelRequest | ||
{ | ||
DataStoreAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"), | ||
GcsTrainingInput = new TrainCustomModelRequest.Types.GcsTrainingInput(), | ||
ModelType = "", | ||
ErrorConfig = new ImportErrorConfig(), | ||
}; | ||
// Make the request | ||
Operation<TrainCustomModelResponse, TrainCustomModelMetadata> response = await searchTuningServiceClient.TrainCustomModelAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<TrainCustomModelResponse, TrainCustomModelMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
TrainCustomModelResponse result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<TrainCustomModelResponse, TrainCustomModelMetadata> retrievedResponse = await searchTuningServiceClient.PollOnceTrainCustomModelAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
TrainCustomModelResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_SearchTuningService_TrainCustomModel_async] | ||
} |
66 changes: 66 additions & 0 deletions
66
...eta.GeneratedSnippets/SearchTuningServiceClient.TrainCustomModelRequestObjectSnippet.g.cs
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,66 @@ | ||
// 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. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START discoveryengine_v1beta_generated_SearchTuningService_TrainCustomModel_sync] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedSearchTuningServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for TrainCustomModel</summary> | ||
/// <remarks> | ||
/// This snippet 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 as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void TrainCustomModelRequestObject() | ||
{ | ||
// Create client | ||
SearchTuningServiceClient searchTuningServiceClient = SearchTuningServiceClient.Create(); | ||
// Initialize request argument(s) | ||
TrainCustomModelRequest request = new TrainCustomModelRequest | ||
{ | ||
DataStoreAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"), | ||
GcsTrainingInput = new TrainCustomModelRequest.Types.GcsTrainingInput(), | ||
ModelType = "", | ||
ErrorConfig = new ImportErrorConfig(), | ||
}; | ||
// Make the request | ||
Operation<TrainCustomModelResponse, TrainCustomModelMetadata> response = searchTuningServiceClient.TrainCustomModel(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<TrainCustomModelResponse, TrainCustomModelMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
TrainCustomModelResponse result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<TrainCustomModelResponse, TrainCustomModelMetadata> retrievedResponse = searchTuningServiceClient.PollOnceTrainCustomModel(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
TrainCustomModelResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_SearchTuningService_TrainCustomModel_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
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
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
79 changes: 79 additions & 0 deletions
79
...atedSnippets/ServingConfigServiceClient.ListServingConfigsResourceNames1AsyncSnippet.g.cs
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,79 @@ | ||
// 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. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START discoveryengine_v1beta_generated_ServingConfigService_ListServingConfigs_async_flattened_resourceNames1] | ||
using Google.Api.Gax; | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedServingConfigServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for ListServingConfigsAsync</summary> | ||
/// <remarks> | ||
/// This snippet 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 as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task ListServingConfigsResourceNames1Async() | ||
{ | ||
// Create client | ||
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
EngineName parent = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"); | ||
// Make the request | ||
PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigsAsync(parent); | ||
|
||
// Iterate over all response items, lazily performing RPCs as required | ||
await response.ForEachAsync((ServingConfig item) => | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
}); | ||
|
||
// Or iterate over pages (of server-defined size), performing one RPC per page | ||
await response.AsRawResponses().ForEachAsync((ListServingConfigsResponse page) => | ||
{ | ||
// Do something with each page of items | ||
Console.WriteLine("A page of results:"); | ||
foreach (ServingConfig item in page) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
}); | ||
|
||
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required | ||
int pageSize = 10; | ||
Page<ServingConfig> singlePage = await response.ReadPageAsync(pageSize); | ||
// Do something with the page of items | ||
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); | ||
foreach (ServingConfig item in singlePage) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
// Store the pageToken, for when the next page is required. | ||
string nextPageToken = singlePage.NextPageToken; | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_ServingConfigService_ListServingConfigs_async_flattened_resourceNames1] | ||
} |
77 changes: 77 additions & 0 deletions
77
...GeneratedSnippets/ServingConfigServiceClient.ListServingConfigsResourceNames1Snippet.g.cs
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 @@ | ||
// 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. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START discoveryengine_v1beta_generated_ServingConfigService_ListServingConfigs_sync_flattened_resourceNames1] | ||
using Google.Api.Gax; | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using System; | ||
|
||
public sealed partial class GeneratedServingConfigServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for ListServingConfigs</summary> | ||
/// <remarks> | ||
/// This snippet 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 as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void ListServingConfigsResourceNames1() | ||
{ | ||
// Create client | ||
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create(); | ||
// Initialize request argument(s) | ||
EngineName parent = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"); | ||
// Make the request | ||
PagedEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigs(parent); | ||
|
||
// Iterate over all response items, lazily performing RPCs as required | ||
foreach (ServingConfig item in response) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
|
||
// Or iterate over pages (of server-defined size), performing one RPC per page | ||
foreach (ListServingConfigsResponse page in response.AsRawResponses()) | ||
{ | ||
// Do something with each page of items | ||
Console.WriteLine("A page of results:"); | ||
foreach (ServingConfig item in page) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
} | ||
|
||
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required | ||
int pageSize = 10; | ||
Page<ServingConfig> singlePage = response.ReadPage(pageSize); | ||
// Do something with the page of items | ||
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); | ||
foreach (ServingConfig item in singlePage) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
// Store the pageToken, for when the next page is required. | ||
string nextPageToken = singlePage.NextPageToken; | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_ServingConfigService_ListServingConfigs_sync_flattened_resourceNames1] | ||
} |
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
Oops, something went wrong.