Skip to content

Commit 449b11f

Browse files
gcf-owl-bot[bot]amanda-tarafa
authored andcommitted
feat: Add new RPC IngestContextReferences, GenerateSuggestions
docs: clarified wording around phrase_sets PiperOrigin-RevId: 733912069 Source-Link: googleapis/googleapis@c57048e Source-Link: googleapis/googleapis-gen@d295b21 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRGlhbG9nZmxvdy5WMi8uT3dsQm90LnlhbWwiLCJoIjoiZDI5NWIyMTA5MGNkOTBkMGIyZjg5NWQ1MjY5ZjcxOGIxZjlmYmVlOCJ9
1 parent a99144f commit 449b11f

25 files changed

+6189
-1389
lines changed

apis/Google.Cloud.Dialogflow.V2/Google.Cloud.Dialogflow.V2.GeneratedSnippets/ConversationsClient.GenerateStatelessSuggestionRequestObjectAsyncSnippet.g.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ public async Task GenerateStatelessSuggestionRequestObjectAsync()
4040
{
4141
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
4242
Generator = new Generator(),
43+
ContextReferences =
44+
{
45+
{
46+
"",
47+
new Conversation.Types.ContextReference()
48+
},
49+
},
4350
ConversationContext = new ConversationContext(),
4451
TriggerEvents =
4552
{

apis/Google.Cloud.Dialogflow.V2/Google.Cloud.Dialogflow.V2.GeneratedSnippets/ConversationsClient.GenerateStatelessSuggestionRequestObjectSnippet.g.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ public void GenerateStatelessSuggestionRequestObject()
3939
{
4040
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
4141
Generator = new Generator(),
42+
ContextReferences =
43+
{
44+
{
45+
"",
46+
new Conversation.Types.ContextReference()
47+
},
48+
},
4249
ConversationContext = new ConversationContext(),
4350
TriggerEvents =
4451
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START dialogflow_v2_generated_Conversations_GenerateSuggestions_async_flattened]
20+
using Google.Cloud.Dialogflow.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedConversationsClientSnippets
24+
{
25+
/// <summary>Snippet for GenerateSuggestionsAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task GenerateSuggestionsAsync()
34+
{
35+
// Create client
36+
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
37+
// Initialize request argument(s)
38+
string conversation = "projects/[PROJECT]/conversations/[CONVERSATION]";
39+
// Make the request
40+
GenerateSuggestionsResponse response = await conversationsClient.GenerateSuggestionsAsync(conversation);
41+
}
42+
}
43+
// [END dialogflow_v2_generated_Conversations_GenerateSuggestions_async_flattened]
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START dialogflow_v2_generated_Conversations_GenerateSuggestions_async]
20+
using Google.Cloud.Dialogflow.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedConversationsClientSnippets
24+
{
25+
/// <summary>Snippet for GenerateSuggestionsAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task GenerateSuggestionsRequestObjectAsync()
34+
{
35+
// Create client
36+
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
37+
// Initialize request argument(s)
38+
GenerateSuggestionsRequest request = new GenerateSuggestionsRequest
39+
{
40+
ConversationAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
41+
LatestMessageAsMessageName = MessageName.FromProjectConversationMessage("[PROJECT]", "[CONVERSATION]", "[MESSAGE]"),
42+
TriggerEvents =
43+
{
44+
TriggerEvent.Unspecified,
45+
},
46+
};
47+
// Make the request
48+
GenerateSuggestionsResponse response = await conversationsClient.GenerateSuggestionsAsync(request);
49+
}
50+
}
51+
// [END dialogflow_v2_generated_Conversations_GenerateSuggestions_async]
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START dialogflow_v2_generated_Conversations_GenerateSuggestions_sync]
20+
using Google.Cloud.Dialogflow.V2;
21+
22+
public sealed partial class GeneratedConversationsClientSnippets
23+
{
24+
/// <summary>Snippet for GenerateSuggestions</summary>
25+
/// <remarks>
26+
/// This snippet has been automatically generated and should be regarded as a code template only.
27+
/// It will require modifications to work:
28+
/// - It may require correct/in-range values for request initialization.
29+
/// - It may require specifying regional endpoints when creating the service client as shown in
30+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
31+
/// </remarks>
32+
public void GenerateSuggestionsRequestObject()
33+
{
34+
// Create client
35+
ConversationsClient conversationsClient = ConversationsClient.Create();
36+
// Initialize request argument(s)
37+
GenerateSuggestionsRequest request = new GenerateSuggestionsRequest
38+
{
39+
ConversationAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
40+
LatestMessageAsMessageName = MessageName.FromProjectConversationMessage("[PROJECT]", "[CONVERSATION]", "[MESSAGE]"),
41+
TriggerEvents =
42+
{
43+
TriggerEvent.Unspecified,
44+
},
45+
};
46+
// Make the request
47+
GenerateSuggestionsResponse response = conversationsClient.GenerateSuggestions(request);
48+
}
49+
}
50+
// [END dialogflow_v2_generated_Conversations_GenerateSuggestions_sync]
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START dialogflow_v2_generated_Conversations_GenerateSuggestions_async_flattened_resourceNames]
20+
using Google.Cloud.Dialogflow.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedConversationsClientSnippets
24+
{
25+
/// <summary>Snippet for GenerateSuggestionsAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task GenerateSuggestionsResourceNamesAsync()
34+
{
35+
// Create client
36+
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
37+
// Initialize request argument(s)
38+
ConversationName conversation = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
39+
// Make the request
40+
GenerateSuggestionsResponse response = await conversationsClient.GenerateSuggestionsAsync(conversation);
41+
}
42+
}
43+
// [END dialogflow_v2_generated_Conversations_GenerateSuggestions_async_flattened_resourceNames]
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START dialogflow_v2_generated_Conversations_GenerateSuggestions_sync_flattened_resourceNames]
20+
using Google.Cloud.Dialogflow.V2;
21+
22+
public sealed partial class GeneratedConversationsClientSnippets
23+
{
24+
/// <summary>Snippet for GenerateSuggestions</summary>
25+
/// <remarks>
26+
/// This snippet has been automatically generated and should be regarded as a code template only.
27+
/// It will require modifications to work:
28+
/// - It may require correct/in-range values for request initialization.
29+
/// - It may require specifying regional endpoints when creating the service client as shown in
30+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
31+
/// </remarks>
32+
public void GenerateSuggestionsResourceNames()
33+
{
34+
// Create client
35+
ConversationsClient conversationsClient = ConversationsClient.Create();
36+
// Initialize request argument(s)
37+
ConversationName conversation = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
38+
// Make the request
39+
GenerateSuggestionsResponse response = conversationsClient.GenerateSuggestions(conversation);
40+
}
41+
}
42+
// [END dialogflow_v2_generated_Conversations_GenerateSuggestions_sync_flattened_resourceNames]
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START dialogflow_v2_generated_Conversations_GenerateSuggestions_sync_flattened]
20+
using Google.Cloud.Dialogflow.V2;
21+
22+
public sealed partial class GeneratedConversationsClientSnippets
23+
{
24+
/// <summary>Snippet for GenerateSuggestions</summary>
25+
/// <remarks>
26+
/// This snippet has been automatically generated and should be regarded as a code template only.
27+
/// It will require modifications to work:
28+
/// - It may require correct/in-range values for request initialization.
29+
/// - It may require specifying regional endpoints when creating the service client as shown in
30+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
31+
/// </remarks>
32+
public void GenerateSuggestions()
33+
{
34+
// Create client
35+
ConversationsClient conversationsClient = ConversationsClient.Create();
36+
// Initialize request argument(s)
37+
string conversation = "projects/[PROJECT]/conversations/[CONVERSATION]";
38+
// Make the request
39+
GenerateSuggestionsResponse response = conversationsClient.GenerateSuggestions(conversation);
40+
}
41+
}
42+
// [END dialogflow_v2_generated_Conversations_GenerateSuggestions_sync_flattened]
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START dialogflow_v2_generated_Conversations_IngestContextReferences_async_flattened]
20+
using Google.Cloud.Dialogflow.V2;
21+
using System.Collections.Generic;
22+
using System.Threading.Tasks;
23+
24+
public sealed partial class GeneratedConversationsClientSnippets
25+
{
26+
/// <summary>Snippet for IngestContextReferencesAsync</summary>
27+
/// <remarks>
28+
/// This snippet has been automatically generated and should be regarded as a code template only.
29+
/// It will require modifications to work:
30+
/// - It may require correct/in-range values for request initialization.
31+
/// - It may require specifying regional endpoints when creating the service client as shown in
32+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
33+
/// </remarks>
34+
public async Task IngestContextReferencesAsync()
35+
{
36+
// Create client
37+
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
38+
// Initialize request argument(s)
39+
string conversation = "projects/[PROJECT]/conversations/[CONVERSATION]";
40+
IDictionary<string, Conversation.Types.ContextReference> contextReferences = new Dictionary<string, Conversation.Types.ContextReference>
41+
{
42+
{
43+
"",
44+
new Conversation.Types.ContextReference()
45+
},
46+
};
47+
// Make the request
48+
IngestContextReferencesResponse response = await conversationsClient.IngestContextReferencesAsync(conversation, contextReferences);
49+
}
50+
}
51+
// [END dialogflow_v2_generated_Conversations_IngestContextReferences_async_flattened]
52+
}

0 commit comments

Comments
 (0)