Skip to content

Commit

Permalink
feat: support import data from Cloud Spanner, BigTable, SQL and Fires…
Browse files Browse the repository at this point in the history
…tore

feat: add answer generation APIs
feat: add standalone grounding API
feat: add standalone ranking API
feat: support advanced search boosting
feat: add advanced engine model APIs
docs: keep the API doc up-to-date with recent changes

PiperOrigin-RevId: 623543290

Source-Link: googleapis/googleapis@5fadb63

Source-Link: googleapis/googleapis-gen@589978b
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRGlzY292ZXJ5RW5naW5lLlYxQmV0YS8uT3dsQm90LnlhbWwiLCJoIjoiNTg5OTc4YjBhMzNkNDZlODdiN2JkMGQ4MDE3NzM5Y2RjYWUyYWNjYyJ9
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed Apr 10, 2024
1 parent 7a7acef commit 2a2996a
Show file tree
Hide file tree
Showing 106 changed files with 37,717 additions and 2,456 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// 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_ConversationalSearchService_AnswerQuery_async]
using Google.Cloud.DiscoveryEngine.V1Beta;
using System.Threading.Tasks;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for AnswerQueryAsync</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 AnswerQueryRequestObjectAsync()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = await ConversationalSearchServiceClient.CreateAsync();
// Initialize request argument(s)
AnswerQueryRequest request = new AnswerQueryRequest
{
ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationDataStoreServingConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]"),
Query = new Query(),
SessionAsSessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
SafetySpec = new AnswerQueryRequest.Types.SafetySpec(),
RelatedQuestionsSpec = new AnswerQueryRequest.Types.RelatedQuestionsSpec(),
AnswerGenerationSpec = new AnswerQueryRequest.Types.AnswerGenerationSpec(),
SearchSpec = new AnswerQueryRequest.Types.SearchSpec(),
QueryUnderstandingSpec = new AnswerQueryRequest.Types.QueryUnderstandingSpec(),
AsynchronousMode = false,
UserPseudoId = "",
};
// Make the request
AnswerQueryResponse response = await conversationalSearchServiceClient.AnswerQueryAsync(request);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_AnswerQuery_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// 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_ConversationalSearchService_AnswerQuery_sync]
using Google.Cloud.DiscoveryEngine.V1Beta;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for AnswerQuery</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 AnswerQueryRequestObject()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = ConversationalSearchServiceClient.Create();
// Initialize request argument(s)
AnswerQueryRequest request = new AnswerQueryRequest
{
ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationDataStoreServingConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]"),
Query = new Query(),
SessionAsSessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
SafetySpec = new AnswerQueryRequest.Types.SafetySpec(),
RelatedQuestionsSpec = new AnswerQueryRequest.Types.RelatedQuestionsSpec(),
AnswerGenerationSpec = new AnswerQueryRequest.Types.AnswerGenerationSpec(),
SearchSpec = new AnswerQueryRequest.Types.SearchSpec(),
QueryUnderstandingSpec = new AnswerQueryRequest.Types.QueryUnderstandingSpec(),
AsynchronousMode = false,
UserPseudoId = "",
};
// Make the request
AnswerQueryResponse response = conversationalSearchServiceClient.AnswerQuery(request);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_AnswerQuery_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 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_ConversationalSearchService_CreateSession_async_flattened]
using Google.Cloud.DiscoveryEngine.V1Beta;
using System.Threading.Tasks;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for CreateSessionAsync</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 CreateSessionAsync()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = await ConversationalSearchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]";
Session session = new Session();
// Make the request
Session response = await conversationalSearchServiceClient.CreateSessionAsync(parent, session);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateSession_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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_ConversationalSearchService_CreateSession_async]
using Google.Cloud.DiscoveryEngine.V1Beta;
using System.Threading.Tasks;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for CreateSessionAsync</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 CreateSessionRequestObjectAsync()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = await ConversationalSearchServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Session = new Session(),
};
// Make the request
Session response = await conversationalSearchServiceClient.CreateSessionAsync(request);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateSession_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// 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_ConversationalSearchService_CreateSession_sync]
using Google.Cloud.DiscoveryEngine.V1Beta;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for CreateSession</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 CreateSessionRequestObject()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = ConversationalSearchServiceClient.Create();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Session = new Session(),
};
// Make the request
Session response = conversationalSearchServiceClient.CreateSession(request);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateSession_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 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_ConversationalSearchService_CreateSession_async_flattened_resourceNames]
using Google.Cloud.DiscoveryEngine.V1Beta;
using System.Threading.Tasks;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for CreateSessionAsync</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 CreateSessionResourceNamesAsync()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = await ConversationalSearchServiceClient.CreateAsync();
// Initialize request argument(s)
DataStoreName parent = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
Session session = new Session();
// Make the request
Session response = await conversationalSearchServiceClient.CreateSessionAsync(parent, session);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateSession_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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_ConversationalSearchService_CreateSession_sync_flattened_resourceNames]
using Google.Cloud.DiscoveryEngine.V1Beta;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for CreateSession</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 CreateSessionResourceNames()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = ConversationalSearchServiceClient.Create();
// Initialize request argument(s)
DataStoreName parent = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
Session session = new Session();
// Make the request
Session response = conversationalSearchServiceClient.CreateSession(parent, session);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateSession_sync_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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_ConversationalSearchService_CreateSession_sync_flattened]
using Google.Cloud.DiscoveryEngine.V1Beta;

public sealed partial class GeneratedConversationalSearchServiceClientSnippets
{
/// <summary>Snippet for CreateSession</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 CreateSession()
{
// Create client
ConversationalSearchServiceClient conversationalSearchServiceClient = ConversationalSearchServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]";
Session session = new Session();
// Make the request
Session response = conversationalSearchServiceClient.CreateSession(parent, session);
}
}
// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateSession_sync_flattened]
}
Loading

0 comments on commit 2a2996a

Please sign in to comment.