Skip to content

Commit

Permalink
feat: added speech endpointing setting
Browse files Browse the repository at this point in the history
feat: added Knowledge Search API

PiperOrigin-RevId: 560215389

Source-Link: googleapis/googleapis@b1666e6

Source-Link: googleapis/googleapis-gen@07e82b4
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRGlhbG9nZmxvdy5WMi8uT3dsQm90LnlhbWwiLCJoIjoiMDdlODJiNGQ0OTE3NDk0ZDg1MDM5NzIyZjY3M2Q0MDljNGM3MzA1ZiJ9
  • Loading branch information
gcf-owl-bot[bot] authored and anuragsrivstv committed Aug 28, 2023
1 parent d5f12a7 commit b08f369
Show file tree
Hide file tree
Showing 14 changed files with 4,176 additions and 827 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2023 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 dialogflow_v2_generated_Conversations_SearchKnowledge_async]
using Google.Cloud.Dialogflow.V2;
using System.Threading.Tasks;

public sealed partial class GeneratedConversationsClientSnippets
{
/// <summary>Snippet for SearchKnowledgeAsync</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 SearchKnowledgeRequestObjectAsync()
{
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
SearchKnowledgeRequest request = new SearchKnowledgeRequest
{
Query = new TextInput(),
ConversationProfileAsConversationProfileName = ConversationProfileName.FromProjectConversationProfile("[PROJECT]", "[CONVERSATION_PROFILE]"),
SessionId = "",
ConversationAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
LatestMessageAsMessageName = MessageName.FromProjectConversationMessage("[PROJECT]", "[CONVERSATION]", "[MESSAGE]"),
Parent = "",
};
// Make the request
SearchKnowledgeResponse response = await conversationsClient.SearchKnowledgeAsync(request);
}
}
// [END dialogflow_v2_generated_Conversations_SearchKnowledge_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2023 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 dialogflow_v2_generated_Conversations_SearchKnowledge_sync]
using Google.Cloud.Dialogflow.V2;

public sealed partial class GeneratedConversationsClientSnippets
{
/// <summary>Snippet for SearchKnowledge</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 SearchKnowledgeRequestObject()
{
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
SearchKnowledgeRequest request = new SearchKnowledgeRequest
{
Query = new TextInput(),
ConversationProfileAsConversationProfileName = ConversationProfileName.FromProjectConversationProfile("[PROJECT]", "[CONVERSATION_PROFILE]"),
SessionId = "",
ConversationAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
LatestMessageAsMessageName = MessageName.FromProjectConversationMessage("[PROJECT]", "[CONVERSATION]", "[MESSAGE]"),
Parent = "",
};
// Make the request
SearchKnowledgeResponse response = conversationsClient.SearchKnowledge(request);
}
}
// [END dialogflow_v2_generated_Conversations_SearchKnowledge_sync]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11959,6 +11959,103 @@
}
]
},
{
"regionTag": "dialogflow_v2_generated_Conversations_SearchKnowledge_sync",
"title": "SearchKnowledgeRequestObject",
"description": "Snippet for SearchKnowledge",
"file": "ConversationsClient.SearchKnowledgeRequestObjectSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "SearchKnowledge",
"fullName": "Google.Cloud.Dialogflow.V2.ConversationsClient.SearchKnowledge",
"parameters": [
{
"type": "Google.Cloud.Dialogflow.V2.SearchKnowledgeRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "Google.Cloud.Dialogflow.V2.SearchKnowledgeResponse",
"client": {
"shortName": "ConversationsClient",
"fullName": "Google.Cloud.Dialogflow.V2.ConversationsClient"
},
"method": {
"shortName": "SearchKnowledge",
"fullName": "google.cloud.dialogflow.v2.Conversations.SearchKnowledge",
"service": {
"shortName": "Conversations",
"fullName": "google.cloud.dialogflow.v2.Conversations"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 49,
"type": "FULL"
},
{
"start": 34,
"end": 47,
"type": "SHORT"
}
]
},
{
"regionTag": "dialogflow_v2_generated_Conversations_SearchKnowledge_async",
"title": "SearchKnowledgeRequestObjectAsync",
"description": "Snippet for SearchKnowledgeAsync",
"file": "ConversationsClient.SearchKnowledgeRequestObjectAsyncSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "SearchKnowledgeAsync",
"fullName": "Google.Cloud.Dialogflow.V2.ConversationsClient.SearchKnowledgeAsync",
"async": true,
"parameters": [
{
"type": "Google.Cloud.Dialogflow.V2.SearchKnowledgeRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "System.Threading.Tasks.Task<Google.Cloud.Dialogflow.V2.SearchKnowledgeResponse>",
"client": {
"shortName": "ConversationsClient",
"fullName": "Google.Cloud.Dialogflow.V2.ConversationsClient"
},
"method": {
"shortName": "SearchKnowledge",
"fullName": "google.cloud.dialogflow.v2.Conversations.SearchKnowledge",
"service": {
"shortName": "Conversations",
"fullName": "google.cloud.dialogflow.v2.Conversations"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 50,
"type": "FULL"
},
{
"start": 35,
"end": 48,
"type": "SHORT"
}
]
},
{
"regionTag": "dialogflow_v2_generated_Documents_ListDocuments_sync",
"title": "ListDocumentsRequestObject",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,5 +1101,48 @@ public async Task GenerateStatelessSummaryRequestObjectAsync()
GenerateStatelessSummaryResponse response = await conversationsClient.GenerateStatelessSummaryAsync(request);
// End snippet
}

/// <summary>Snippet for SearchKnowledge</summary>
public void SearchKnowledgeRequestObject()
{
// Snippet: SearchKnowledge(SearchKnowledgeRequest, CallSettings)
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
SearchKnowledgeRequest request = new SearchKnowledgeRequest
{
Query = new TextInput(),
ConversationProfileAsConversationProfileName = ConversationProfileName.FromProjectConversationProfile("[PROJECT]", "[CONVERSATION_PROFILE]"),
SessionId = "",
ConversationAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
LatestMessageAsMessageName = MessageName.FromProjectConversationMessage("[PROJECT]", "[CONVERSATION]", "[MESSAGE]"),
Parent = "",
};
// Make the request
SearchKnowledgeResponse response = conversationsClient.SearchKnowledge(request);
// End snippet
}

/// <summary>Snippet for SearchKnowledgeAsync</summary>
public async Task SearchKnowledgeRequestObjectAsync()
{
// Snippet: SearchKnowledgeAsync(SearchKnowledgeRequest, CallSettings)
// Additional: SearchKnowledgeAsync(SearchKnowledgeRequest, CancellationToken)
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
SearchKnowledgeRequest request = new SearchKnowledgeRequest
{
Query = new TextInput(),
ConversationProfileAsConversationProfileName = ConversationProfileName.FromProjectConversationProfile("[PROJECT]", "[CONVERSATION_PROFILE]"),
SessionId = "",
ConversationAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
LatestMessageAsMessageName = MessageName.FromProjectConversationMessage("[PROJECT]", "[CONVERSATION]", "[MESSAGE]"),
Parent = "",
};
// Make the request
SearchKnowledgeResponse response = await conversationsClient.SearchKnowledgeAsync(request);
// End snippet
}
}
}
Loading

0 comments on commit b08f369

Please sign in to comment.