Skip to content

Commit adbb984

Browse files
feat: Add Agent Assist Summarization API (https://cloud.google.com/agent-assist/docs/summarization) (#1026)
* feat: Add Agent Assist Summarization API (https://cloud.google.com/agent-assist/docs/summarization) docs: clarify SuggestionFeature enums which are specific to chat agents PiperOrigin-RevId: 477479918 Source-Link: googleapis/googleapis@6deca98 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b23d242c5c5deb7ce6f4a7f71862a311555069bd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjIzZDI0MmM1YzVkZWI3Y2U2ZjRhN2Y3MTg2MmEzMTE1NTUwNjliZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent fb66e68 commit adbb984

File tree

24 files changed

+4997
-333
lines changed

24 files changed

+4997
-333
lines changed

java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/ConversationsClient.java

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,148 @@ public final UnaryCallable<ListMessagesRequest, ListMessagesResponse> listMessag
11881188
return stub.listMessagesCallable();
11891189
}
11901190

1191+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1192+
/**
1193+
* Suggest summary for a conversation based on specific historical messages. The range of the
1194+
* messages to be used for summary can be specified in the request.
1195+
*
1196+
* <p>Sample code:
1197+
*
1198+
* <pre>{@code
1199+
* // This snippet has been automatically generated and should be regarded as a code template only.
1200+
* // It will require modifications to work:
1201+
* // - It may require correct/in-range values for request initialization.
1202+
* // - It may require specifying regional endpoints when creating the service client as shown in
1203+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1204+
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
1205+
* ConversationName conversation =
1206+
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");
1207+
* SuggestConversationSummaryResponse response =
1208+
* conversationsClient.suggestConversationSummary(conversation);
1209+
* }
1210+
* }</pre>
1211+
*
1212+
* @param conversation Required. The conversation to fetch suggestion for. Format:
1213+
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/conversations/&lt;Conversation
1214+
* ID&gt;`.
1215+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1216+
*/
1217+
public final SuggestConversationSummaryResponse suggestConversationSummary(
1218+
ConversationName conversation) {
1219+
SuggestConversationSummaryRequest request =
1220+
SuggestConversationSummaryRequest.newBuilder()
1221+
.setConversation(conversation == null ? null : conversation.toString())
1222+
.build();
1223+
return suggestConversationSummary(request);
1224+
}
1225+
1226+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1227+
/**
1228+
* Suggest summary for a conversation based on specific historical messages. The range of the
1229+
* messages to be used for summary can be specified in the request.
1230+
*
1231+
* <p>Sample code:
1232+
*
1233+
* <pre>{@code
1234+
* // This snippet has been automatically generated and should be regarded as a code template only.
1235+
* // It will require modifications to work:
1236+
* // - It may require correct/in-range values for request initialization.
1237+
* // - It may require specifying regional endpoints when creating the service client as shown in
1238+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1239+
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
1240+
* String conversation =
1241+
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]").toString();
1242+
* SuggestConversationSummaryResponse response =
1243+
* conversationsClient.suggestConversationSummary(conversation);
1244+
* }
1245+
* }</pre>
1246+
*
1247+
* @param conversation Required. The conversation to fetch suggestion for. Format:
1248+
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/conversations/&lt;Conversation
1249+
* ID&gt;`.
1250+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1251+
*/
1252+
public final SuggestConversationSummaryResponse suggestConversationSummary(String conversation) {
1253+
SuggestConversationSummaryRequest request =
1254+
SuggestConversationSummaryRequest.newBuilder().setConversation(conversation).build();
1255+
return suggestConversationSummary(request);
1256+
}
1257+
1258+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1259+
/**
1260+
* Suggest summary for a conversation based on specific historical messages. The range of the
1261+
* messages to be used for summary can be specified in the request.
1262+
*
1263+
* <p>Sample code:
1264+
*
1265+
* <pre>{@code
1266+
* // This snippet has been automatically generated and should be regarded as a code template only.
1267+
* // It will require modifications to work:
1268+
* // - It may require correct/in-range values for request initialization.
1269+
* // - It may require specifying regional endpoints when creating the service client as shown in
1270+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1271+
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
1272+
* SuggestConversationSummaryRequest request =
1273+
* SuggestConversationSummaryRequest.newBuilder()
1274+
* .setConversation(
1275+
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
1276+
* .toString())
1277+
* .setLatestMessage(
1278+
* MessageName.ofProjectConversationMessageName(
1279+
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
1280+
* .toString())
1281+
* .setContextSize(1116903569)
1282+
* .build();
1283+
* SuggestConversationSummaryResponse response =
1284+
* conversationsClient.suggestConversationSummary(request);
1285+
* }
1286+
* }</pre>
1287+
*
1288+
* @param request The request object containing all of the parameters for the API call.
1289+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1290+
*/
1291+
public final SuggestConversationSummaryResponse suggestConversationSummary(
1292+
SuggestConversationSummaryRequest request) {
1293+
return suggestConversationSummaryCallable().call(request);
1294+
}
1295+
1296+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1297+
/**
1298+
* Suggest summary for a conversation based on specific historical messages. The range of the
1299+
* messages to be used for summary can be specified in the request.
1300+
*
1301+
* <p>Sample code:
1302+
*
1303+
* <pre>{@code
1304+
* // This snippet has been automatically generated and should be regarded as a code template only.
1305+
* // It will require modifications to work:
1306+
* // - It may require correct/in-range values for request initialization.
1307+
* // - It may require specifying regional endpoints when creating the service client as shown in
1308+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1309+
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
1310+
* SuggestConversationSummaryRequest request =
1311+
* SuggestConversationSummaryRequest.newBuilder()
1312+
* .setConversation(
1313+
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
1314+
* .toString())
1315+
* .setLatestMessage(
1316+
* MessageName.ofProjectConversationMessageName(
1317+
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
1318+
* .toString())
1319+
* .setContextSize(1116903569)
1320+
* .build();
1321+
* ApiFuture<SuggestConversationSummaryResponse> future =
1322+
* conversationsClient.suggestConversationSummaryCallable().futureCall(request);
1323+
* // Do something.
1324+
* SuggestConversationSummaryResponse response = future.get();
1325+
* }
1326+
* }</pre>
1327+
*/
1328+
public final UnaryCallable<SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
1329+
suggestConversationSummaryCallable() {
1330+
return stub.suggestConversationSummaryCallable();
1331+
}
1332+
11911333
// AUTO-GENERATED DOCUMENTATION AND METHOD.
11921334
/**
11931335
* Lists information about the supported locations for this service.

java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/ConversationsSettings.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ public UnaryCallSettings<GetConversationRequest, Conversation> getConversationSe
113113
return ((ConversationsStubSettings) getStubSettings()).listMessagesSettings();
114114
}
115115

116+
/** Returns the object with the settings used for calls to suggestConversationSummary. */
117+
public UnaryCallSettings<SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
118+
suggestConversationSummarySettings() {
119+
return ((ConversationsStubSettings) getStubSettings()).suggestConversationSummarySettings();
120+
}
121+
116122
/** Returns the object with the settings used for calls to listLocations. */
117123
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
118124
listLocationsSettings() {
@@ -277,6 +283,13 @@ public Builder applyToAllUnaryMethods(
277283
return getStubSettingsBuilder().listMessagesSettings();
278284
}
279285

286+
/** Returns the builder for the settings used for calls to suggestConversationSummary. */
287+
public UnaryCallSettings.Builder<
288+
SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
289+
suggestConversationSummarySettings() {
290+
return getStubSettingsBuilder().suggestConversationSummarySettings();
291+
}
292+
280293
/** Returns the builder for the settings used for calls to listLocations. */
281294
public PagedCallSettings.Builder<
282295
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@
132132
},
133133
"ListMessages": {
134134
"methods": ["listMessages", "listMessages", "listMessages", "listMessagesPagedCallable", "listMessagesCallable"]
135+
},
136+
"SuggestConversationSummary": {
137+
"methods": ["suggestConversationSummary", "suggestConversationSummary", "suggestConversationSummary", "suggestConversationSummaryCallable"]
135138
}
136139
}
137140
}

java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/stub/ConversationsStub.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import com.google.cloud.dialogflow.v2beta1.ListConversationsResponse;
3434
import com.google.cloud.dialogflow.v2beta1.ListMessagesRequest;
3535
import com.google.cloud.dialogflow.v2beta1.ListMessagesResponse;
36+
import com.google.cloud.dialogflow.v2beta1.SuggestConversationSummaryRequest;
37+
import com.google.cloud.dialogflow.v2beta1.SuggestConversationSummaryResponse;
3638
import com.google.cloud.location.GetLocationRequest;
3739
import com.google.cloud.location.ListLocationsRequest;
3840
import com.google.cloud.location.ListLocationsResponse;
@@ -84,6 +86,12 @@ public UnaryCallable<ListMessagesRequest, ListMessagesResponse> listMessagesCall
8486
throw new UnsupportedOperationException("Not implemented: listMessagesCallable()");
8587
}
8688

89+
public UnaryCallable<SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
90+
suggestConversationSummaryCallable() {
91+
throw new UnsupportedOperationException(
92+
"Not implemented: suggestConversationSummaryCallable()");
93+
}
94+
8795
public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
8896
listLocationsPagedCallable() {
8997
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");

java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/stub/ConversationsStubSettings.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
import com.google.cloud.dialogflow.v2beta1.ListMessagesRequest;
5757
import com.google.cloud.dialogflow.v2beta1.ListMessagesResponse;
5858
import com.google.cloud.dialogflow.v2beta1.Message;
59+
import com.google.cloud.dialogflow.v2beta1.SuggestConversationSummaryRequest;
60+
import com.google.cloud.dialogflow.v2beta1.SuggestConversationSummaryResponse;
5961
import com.google.cloud.location.GetLocationRequest;
6062
import com.google.cloud.location.ListLocationsRequest;
6163
import com.google.cloud.location.ListLocationsResponse;
@@ -126,6 +128,9 @@ public class ConversationsStubSettings extends StubSettings<ConversationsStubSet
126128
private final PagedCallSettings<
127129
ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse>
128130
listMessagesSettings;
131+
private final UnaryCallSettings<
132+
SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
133+
suggestConversationSummarySettings;
129134
private final PagedCallSettings<
130135
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
131136
listLocationsSettings;
@@ -333,6 +338,12 @@ public UnaryCallSettings<GetConversationRequest, Conversation> getConversationSe
333338
return listMessagesSettings;
334339
}
335340

341+
/** Returns the object with the settings used for calls to suggestConversationSummary. */
342+
public UnaryCallSettings<SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
343+
suggestConversationSummarySettings() {
344+
return suggestConversationSummarySettings;
345+
}
346+
336347
/** Returns the object with the settings used for calls to listLocations. */
337348
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
338349
listLocationsSettings() {
@@ -456,6 +467,8 @@ protected ConversationsStubSettings(Builder settingsBuilder) throws IOException
456467
completeConversationSettings = settingsBuilder.completeConversationSettings().build();
457468
batchCreateMessagesSettings = settingsBuilder.batchCreateMessagesSettings().build();
458469
listMessagesSettings = settingsBuilder.listMessagesSettings().build();
470+
suggestConversationSummarySettings =
471+
settingsBuilder.suggestConversationSummarySettings().build();
459472
listLocationsSettings = settingsBuilder.listLocationsSettings().build();
460473
getLocationSettings = settingsBuilder.getLocationSettings().build();
461474
}
@@ -477,6 +490,9 @@ public static class Builder extends StubSettings.Builder<ConversationsStubSettin
477490
private final PagedCallSettings.Builder<
478491
ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse>
479492
listMessagesSettings;
493+
private final UnaryCallSettings.Builder<
494+
SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
495+
suggestConversationSummarySettings;
480496
private final PagedCallSettings.Builder<
481497
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
482498
listLocationsSettings;
@@ -525,6 +541,7 @@ protected Builder(ClientContext clientContext) {
525541
completeConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
526542
batchCreateMessagesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
527543
listMessagesSettings = PagedCallSettings.newBuilder(LIST_MESSAGES_PAGE_STR_FACT);
544+
suggestConversationSummarySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
528545
listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT);
529546
getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
530547

@@ -536,6 +553,7 @@ protected Builder(ClientContext clientContext) {
536553
completeConversationSettings,
537554
batchCreateMessagesSettings,
538555
listMessagesSettings,
556+
suggestConversationSummarySettings,
539557
listLocationsSettings,
540558
getLocationSettings);
541559
initDefaults(this);
@@ -550,6 +568,7 @@ protected Builder(ConversationsStubSettings settings) {
550568
completeConversationSettings = settings.completeConversationSettings.toBuilder();
551569
batchCreateMessagesSettings = settings.batchCreateMessagesSettings.toBuilder();
552570
listMessagesSettings = settings.listMessagesSettings.toBuilder();
571+
suggestConversationSummarySettings = settings.suggestConversationSummarySettings.toBuilder();
553572
listLocationsSettings = settings.listLocationsSettings.toBuilder();
554573
getLocationSettings = settings.getLocationSettings.toBuilder();
555574

@@ -561,6 +580,7 @@ protected Builder(ConversationsStubSettings settings) {
561580
completeConversationSettings,
562581
batchCreateMessagesSettings,
563582
listMessagesSettings,
583+
suggestConversationSummarySettings,
564584
listLocationsSettings,
565585
getLocationSettings);
566586
}
@@ -622,6 +642,11 @@ private static Builder initDefaults(Builder builder) {
622642
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
623643
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
624644

645+
builder
646+
.suggestConversationSummarySettings()
647+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
648+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
649+
625650
builder
626651
.listLocationsSettings()
627652
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
@@ -688,6 +713,13 @@ public Builder applyToAllUnaryMethods(
688713
return listMessagesSettings;
689714
}
690715

716+
/** Returns the builder for the settings used for calls to suggestConversationSummary. */
717+
public UnaryCallSettings.Builder<
718+
SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
719+
suggestConversationSummarySettings() {
720+
return suggestConversationSummarySettings;
721+
}
722+
691723
/** Returns the builder for the settings used for calls to listLocations. */
692724
public PagedCallSettings.Builder<
693725
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

0 commit comments

Comments
 (0)