Skip to content

Commit

Permalink
feat: add data store, engine, serving config and site search engine s…
Browse files Browse the repository at this point in the history
…ervices

feat: support search summarization with citations and references
feat: add suggestion deny list import/purge APIs
feat: add engine support for multi-turn search and search APIs
docs: keep the API doc up-to-date with recent changes

PiperOrigin-RevId: 605344453

Source-Link: googleapis/googleapis@4fd031d

Source-Link: googleapis/googleapis-gen@b77d7a4
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRGlzY292ZXJ5RW5naW5lLlYxQmV0YS8uT3dsQm90LnlhbWwiLCJoIjoiYjc3ZDdhNDQ2YzJlODU5ZGFkMTZhZmQwYTFkMWU4ZjUwM2ZiYTg4NCJ9
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed Feb 8, 2024
1 parent eb2157a commit b2d79e6
Show file tree
Hide file tree
Showing 179 changed files with 53,130 additions and 2,024 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// 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_CompletionService_ImportSuggestionDenyListEntries_async]
using Google.Cloud.DiscoveryEngine.V1Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedCompletionServiceClientSnippets
{
/// <summary>Snippet for ImportSuggestionDenyListEntriesAsync</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 ImportSuggestionDenyListEntriesRequestObjectAsync()
{
// Create client
CompletionServiceClient completionServiceClient = await CompletionServiceClient.CreateAsync();
// Initialize request argument(s)
ImportSuggestionDenyListEntriesRequest request = new ImportSuggestionDenyListEntriesRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
InlineSource = new ImportSuggestionDenyListEntriesRequest.Types.InlineSource(),
};
// Make the request
Operation<ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata> response = await completionServiceClient.ImportSuggestionDenyListEntriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportSuggestionDenyListEntriesResponse 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<ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata> retrievedResponse = await completionServiceClient.PollOnceImportSuggestionDenyListEntriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ImportSuggestionDenyListEntriesResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END discoveryengine_v1beta_generated_CompletionService_ImportSuggestionDenyListEntries_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// 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_CompletionService_ImportSuggestionDenyListEntries_sync]
using Google.Cloud.DiscoveryEngine.V1Beta;
using Google.LongRunning;

public sealed partial class GeneratedCompletionServiceClientSnippets
{
/// <summary>Snippet for ImportSuggestionDenyListEntries</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 ImportSuggestionDenyListEntriesRequestObject()
{
// Create client
CompletionServiceClient completionServiceClient = CompletionServiceClient.Create();
// Initialize request argument(s)
ImportSuggestionDenyListEntriesRequest request = new ImportSuggestionDenyListEntriesRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
InlineSource = new ImportSuggestionDenyListEntriesRequest.Types.InlineSource(),
};
// Make the request
Operation<ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata> response = completionServiceClient.ImportSuggestionDenyListEntries(request);

// Poll until the returned long-running operation is complete
Operation<ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportSuggestionDenyListEntriesResponse 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<ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata> retrievedResponse = completionServiceClient.PollOnceImportSuggestionDenyListEntries(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ImportSuggestionDenyListEntriesResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END discoveryengine_v1beta_generated_CompletionService_ImportSuggestionDenyListEntries_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// 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_CompletionService_PurgeSuggestionDenyListEntries_async]
using Google.Cloud.DiscoveryEngine.V1Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedCompletionServiceClientSnippets
{
/// <summary>Snippet for PurgeSuggestionDenyListEntriesAsync</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 PurgeSuggestionDenyListEntriesRequestObjectAsync()
{
// Create client
CompletionServiceClient completionServiceClient = await CompletionServiceClient.CreateAsync();
// Initialize request argument(s)
PurgeSuggestionDenyListEntriesRequest request = new PurgeSuggestionDenyListEntriesRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
};
// Make the request
Operation<PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata> response = await completionServiceClient.PurgeSuggestionDenyListEntriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PurgeSuggestionDenyListEntriesResponse 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<PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata> retrievedResponse = await completionServiceClient.PollOncePurgeSuggestionDenyListEntriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PurgeSuggestionDenyListEntriesResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END discoveryengine_v1beta_generated_CompletionService_PurgeSuggestionDenyListEntries_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// 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_CompletionService_PurgeSuggestionDenyListEntries_sync]
using Google.Cloud.DiscoveryEngine.V1Beta;
using Google.LongRunning;

public sealed partial class GeneratedCompletionServiceClientSnippets
{
/// <summary>Snippet for PurgeSuggestionDenyListEntries</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 PurgeSuggestionDenyListEntriesRequestObject()
{
// Create client
CompletionServiceClient completionServiceClient = CompletionServiceClient.Create();
// Initialize request argument(s)
PurgeSuggestionDenyListEntriesRequest request = new PurgeSuggestionDenyListEntriesRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
};
// Make the request
Operation<PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata> response = completionServiceClient.PurgeSuggestionDenyListEntries(request);

// Poll until the returned long-running operation is complete
Operation<PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PurgeSuggestionDenyListEntriesResponse 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<PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata> retrievedResponse = completionServiceClient.PollOncePurgeSuggestionDenyListEntries(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PurgeSuggestionDenyListEntriesResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END discoveryengine_v1beta_generated_CompletionService_PurgeSuggestionDenyListEntries_sync]
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public async Task ConverseConversationRequestObjectAsync()
SafeSearch = false,
UserLabels = { { "", "" }, },
SummarySpec = new SearchRequest.Types.ContentSearchSpec.Types.SummarySpec(),
Filter = "",
};
// Make the request
ConverseConversationResponse response = await conversationalSearchServiceClient.ConverseConversationAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public void ConverseConversationRequestObject()
SafeSearch = false,
UserLabels = { { "", "" }, },
SummarySpec = new SearchRequest.Types.ContentSearchSpec.Types.SummarySpec(),
Filter = "",
};
// Make the request
ConverseConversationResponse response = conversationalSearchServiceClient.ConverseConversation(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// 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_DataStoreService_CreateDataStore_async_flattened]
using Google.Cloud.DiscoveryEngine.V1Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedDataStoreServiceClientSnippets
{
/// <summary>Snippet for CreateDataStoreAsync</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 CreateDataStoreAsync()
{
// Create client
DataStoreServiceClient dataStoreServiceClient = await DataStoreServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
DataStore dataStore = new DataStore();
string dataStoreId = "";
// Make the request
Operation<DataStore, CreateDataStoreMetadata> response = await dataStoreServiceClient.CreateDataStoreAsync(parent, dataStore, dataStoreId);

// Poll until the returned long-running operation is complete
Operation<DataStore, CreateDataStoreMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DataStore 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<DataStore, CreateDataStoreMetadata> retrievedResponse = await dataStoreServiceClient.PollOnceCreateDataStoreAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DataStore retrievedResult = retrievedResponse.Result;
}
}
}
// [END discoveryengine_v1beta_generated_DataStoreService_CreateDataStore_async_flattened]
}
Loading

0 comments on commit b2d79e6

Please sign in to comment.