Skip to content

Commit

Permalink
feat: [dialogflow] Add Agent Assist Summarization API (https://cloud.…
Browse files Browse the repository at this point in the history
…google.com/agent-assist/docs/summarization) (#8481)

* 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: googleapis/googleapis-gen@b23d242
Copy-Tag: eyJwIjoiamF2YS1kaWFsb2dmbG93Ly5Pd2xCb3QueWFtbCIsImgiOiJiMjNkMjQyYzVjNWRlYjdjZTZmNGE3ZjcxODYyYTMxMTU1NTA2OWJkIn0=

* 🦉 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Sep 29, 2022
1 parent 427df3a commit cda60cf
Show file tree
Hide file tree
Showing 31 changed files with 5,350 additions and 395 deletions.
61 changes: 4 additions & 57 deletions java-dialogflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,28 @@ Java idiomatic client for [Dialogflow API][product-docs].

## Quickstart

If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:

```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.1.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-dialogflow</artifactId>
</dependency>

```

If you are using Maven without BOM, add this to your dependencies:
If you are using Maven, add this to your pom.xml file:


```xml
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-dialogflow</artifactId>
<version>4.8.1</version>
<version>4.8.6</version>
</dependency>

```

If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.1.1')
implementation 'com.google.cloud:google-cloud-dialogflow'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-dialogflow:4.8.1'
implementation 'com.google.cloud:google-cloud-dialogflow:4.8.6'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow" % "4.8.1"
libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow" % "4.8.6"
```

## Authentication
Expand Down Expand Up @@ -100,29 +70,6 @@ use this Dialogflow API Client Library.



## Samples

Samples are in the [`samples/`](https://github.com/googleapis/java-dialogflow/tree/main/samples) directory.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Conversation Management | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/ConversationManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/ConversationManagement.java) |
| Conversation Profile Management | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/ConversationProfileManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/ConversationProfileManagement.java) |
| Detect Intent Audio | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DetectIntentAudio.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DetectIntentAudio.java) |
| Detect Intent Knowledge | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DetectIntentKnowledge.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DetectIntentKnowledge.java) |
| Detect Intent Stream | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DetectIntentStream.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DetectIntentStream.java) |
| Detect Intent Texts | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DetectIntentTexts.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DetectIntentTexts.java) |
| Detect Intent With Location | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DetectIntentWithLocation.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DetectIntentWithLocation.java) |
| Detect Intent With Sentiment Analysis | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DetectIntentWithSentimentAnalysis.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DetectIntentWithSentimentAnalysis.java) |
| Detect Intent With Text To Speech Response | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DetectIntentWithTextToSpeechResponse.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DetectIntentWithTextToSpeechResponse.java) |
| Document Management | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/DocumentManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/DocumentManagement.java) |
| Intent Management | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/IntentManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/IntentManagement.java) |
| Knowledge Base Management | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/KnowledgeBaseManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/KnowledgeBaseManagement.java) |
| List Training Phrases | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/ListTrainingPhrases.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/ListTrainingPhrases.java) |
| Participant Management | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/ParticipantManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/ParticipantManagement.java) |
| Update Intent | [source code](https://github.com/googleapis/java-dialogflow/blob/main/samples/snippets/src/main/java/com/example/dialogflow/UpdateIntent.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-dialogflow&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/dialogflow/UpdateIntent.java) |



## Troubleshooting

Expand Down
10 changes: 5 additions & 5 deletions java-dialogflow/google-cloud-dialogflow-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,27 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-dialogflow</artifactId>
<version>4.8.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-dialogflow:current} -->
<version>4.8.7-SNAPSHOT</version><!-- {x-version-update:google-cloud-dialogflow:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-dialogflow-v2beta1</artifactId>
<version>0.106.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-dialogflow-v2beta1:current} -->
<version>0.106.7-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-dialogflow-v2beta1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-dialogflow-v2</artifactId>
<version>4.8.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-dialogflow-v2:current} -->
<version>4.8.7-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-dialogflow-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-dialogflow-v2</artifactId>
<version>4.8.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-dialogflow-v2:current} -->
<version>4.8.7-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-dialogflow-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-dialogflow-v2beta1</artifactId>
<version>0.106.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-dialogflow-v2beta1:current} -->
<version>0.106.7-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-dialogflow-v2beta1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,148 @@ public final UnaryCallable<ListMessagesRequest, ListMessagesResponse> listMessag
return stub.listMessagesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Suggest summary for a conversation based on specific historical messages. The range of the
* messages to be used for summary can be specified in the request.
*
* <p>Sample code:
*
* <pre>{@code
* // 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/java/docs/setup#configure_endpoints_for_the_client_library
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
* ConversationName conversation =
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");
* SuggestConversationSummaryResponse response =
* conversationsClient.suggestConversationSummary(conversation);
* }
* }</pre>
*
* @param conversation Required. The conversation to fetch suggestion for. Format:
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/conversations/&lt;Conversation
* ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SuggestConversationSummaryResponse suggestConversationSummary(
ConversationName conversation) {
SuggestConversationSummaryRequest request =
SuggestConversationSummaryRequest.newBuilder()
.setConversation(conversation == null ? null : conversation.toString())
.build();
return suggestConversationSummary(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Suggest summary for a conversation based on specific historical messages. The range of the
* messages to be used for summary can be specified in the request.
*
* <p>Sample code:
*
* <pre>{@code
* // 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/java/docs/setup#configure_endpoints_for_the_client_library
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
* String conversation =
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]").toString();
* SuggestConversationSummaryResponse response =
* conversationsClient.suggestConversationSummary(conversation);
* }
* }</pre>
*
* @param conversation Required. The conversation to fetch suggestion for. Format:
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/conversations/&lt;Conversation
* ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SuggestConversationSummaryResponse suggestConversationSummary(String conversation) {
SuggestConversationSummaryRequest request =
SuggestConversationSummaryRequest.newBuilder().setConversation(conversation).build();
return suggestConversationSummary(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Suggest summary for a conversation based on specific historical messages. The range of the
* messages to be used for summary can be specified in the request.
*
* <p>Sample code:
*
* <pre>{@code
* // 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/java/docs/setup#configure_endpoints_for_the_client_library
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
* SuggestConversationSummaryRequest request =
* SuggestConversationSummaryRequest.newBuilder()
* .setConversation(
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
* .toString())
* .setLatestMessage(
* MessageName.ofProjectConversationMessageName(
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
* .toString())
* .setContextSize(1116903569)
* .build();
* SuggestConversationSummaryResponse response =
* conversationsClient.suggestConversationSummary(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SuggestConversationSummaryResponse suggestConversationSummary(
SuggestConversationSummaryRequest request) {
return suggestConversationSummaryCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Suggest summary for a conversation based on specific historical messages. The range of the
* messages to be used for summary can be specified in the request.
*
* <p>Sample code:
*
* <pre>{@code
* // 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/java/docs/setup#configure_endpoints_for_the_client_library
* try (ConversationsClient conversationsClient = ConversationsClient.create()) {
* SuggestConversationSummaryRequest request =
* SuggestConversationSummaryRequest.newBuilder()
* .setConversation(
* ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
* .toString())
* .setLatestMessage(
* MessageName.ofProjectConversationMessageName(
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
* .toString())
* .setContextSize(1116903569)
* .build();
* ApiFuture<SuggestConversationSummaryResponse> future =
* conversationsClient.suggestConversationSummaryCallable().futureCall(request);
* // Do something.
* SuggestConversationSummaryResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
suggestConversationSummaryCallable() {
return stub.suggestConversationSummaryCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ public UnaryCallSettings<GetConversationRequest, Conversation> getConversationSe
return ((ConversationsStubSettings) getStubSettings()).listMessagesSettings();
}

/** Returns the object with the settings used for calls to suggestConversationSummary. */
public UnaryCallSettings<SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
suggestConversationSummarySettings() {
return ((ConversationsStubSettings) getStubSettings()).suggestConversationSummarySettings();
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
Expand Down Expand Up @@ -277,6 +283,13 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().listMessagesSettings();
}

/** Returns the builder for the settings used for calls to suggestConversationSummary. */
public UnaryCallSettings.Builder<
SuggestConversationSummaryRequest, SuggestConversationSummaryResponse>
suggestConversationSummarySettings() {
return getStubSettingsBuilder().suggestConversationSummarySettings();
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
},
"ListMessages": {
"methods": ["listMessages", "listMessages", "listMessages", "listMessagesPagedCallable", "listMessagesCallable"]
},
"SuggestConversationSummary": {
"methods": ["suggestConversationSummary", "suggestConversationSummary", "suggestConversationSummary", "suggestConversationSummaryCallable"]
}
}
}
Expand Down
Loading

0 comments on commit cda60cf

Please sign in to comment.