Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

Commit 24afa13

Browse files
feat: support document metadata filter in article suggestion (#773)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 410295622 Source-Link: googleapis/googleapis@dfa9d62 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0096968b1fe0d67ca878187436e406b016e27a0d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA5Njk2OGIxZmUwZDY3Y2E4NzgxODc0MzZlNDA2YjAxNmUyN2EwZCJ9
1 parent a615d5e commit 24afa13

38 files changed

Lines changed: 3900 additions & 662 deletions

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,7 @@ public final AnalyzeContentResponse analyzeContent(String participant, TextInput
754754
* .toString())
755755
* .setReplyAudioConfig(OutputAudioConfig.newBuilder().build())
756756
* .setQueryParams(QueryParameters.newBuilder().build())
757+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
757758
* .setMessageSendTime(Timestamp.newBuilder().build())
758759
* .setRequestId("requestId693933066")
759760
* .build();
@@ -788,6 +789,7 @@ public final AnalyzeContentResponse analyzeContent(AnalyzeContentRequest request
788789
* .toString())
789790
* .setReplyAudioConfig(OutputAudioConfig.newBuilder().build())
790791
* .setQueryParams(QueryParameters.newBuilder().build())
792+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
791793
* .setMessageSendTime(Timestamp.newBuilder().build())
792794
* .setRequestId("requestId693933066")
793795
* .build();
@@ -891,6 +893,7 @@ public final SuggestArticlesResponse suggestArticles(String parent) {
891893
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
892894
* .toString())
893895
* .setContextSize(1116903569)
896+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
894897
* .build();
895898
* SuggestArticlesResponse response = participantsClient.suggestArticles(request);
896899
* }
@@ -927,6 +930,7 @@ public final SuggestArticlesResponse suggestArticles(SuggestArticlesRequest requ
927930
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
928931
* .toString())
929932
* .setContextSize(1116903569)
933+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
930934
* .build();
931935
* ApiFuture<SuggestArticlesResponse> future =
932936
* participantsClient.suggestArticlesCallable().futureCall(request);
@@ -1014,6 +1018,7 @@ public final SuggestFaqAnswersResponse suggestFaqAnswers(String parent) {
10141018
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
10151019
* .toString())
10161020
* .setContextSize(1116903569)
1021+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
10171022
* .build();
10181023
* SuggestFaqAnswersResponse response = participantsClient.suggestFaqAnswers(request);
10191024
* }
@@ -1045,6 +1050,7 @@ public final SuggestFaqAnswersResponse suggestFaqAnswers(SuggestFaqAnswersReques
10451050
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
10461051
* .toString())
10471052
* .setContextSize(1116903569)
1053+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
10481054
* .build();
10491055
* ApiFuture<SuggestFaqAnswersResponse> future =
10501056
* participantsClient.suggestFaqAnswersCallable().futureCall(request);

google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/ParticipantsClientTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.io.IOException;
3434
import java.util.ArrayList;
3535
import java.util.Arrays;
36+
import java.util.HashMap;
3637
import java.util.List;
3738
import java.util.UUID;
3839
import javax.annotation.Generated;
@@ -90,6 +91,7 @@ public void createParticipantTest() throws Exception {
9091
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
9192
.toString())
9293
.setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693")
94+
.putAllDocumentsMetadataFilters(new HashMap<String, String>())
9395
.build();
9496
mockParticipants.addResponse(expectedResponse);
9597

@@ -137,6 +139,7 @@ public void createParticipantTest2() throws Exception {
137139
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
138140
.toString())
139141
.setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693")
142+
.putAllDocumentsMetadataFilters(new HashMap<String, String>())
140143
.build();
141144
mockParticipants.addResponse(expectedResponse);
142145

@@ -182,6 +185,7 @@ public void getParticipantTest() throws Exception {
182185
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
183186
.toString())
184187
.setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693")
188+
.putAllDocumentsMetadataFilters(new HashMap<String, String>())
185189
.build();
186190
mockParticipants.addResponse(expectedResponse);
187191

@@ -228,6 +232,7 @@ public void getParticipantTest2() throws Exception {
228232
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
229233
.toString())
230234
.setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693")
235+
.putAllDocumentsMetadataFilters(new HashMap<String, String>())
231236
.build();
232237
mockParticipants.addResponse(expectedResponse);
233238

@@ -360,6 +365,7 @@ public void updateParticipantTest() throws Exception {
360365
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
361366
.toString())
362367
.setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693")
368+
.putAllDocumentsMetadataFilters(new HashMap<String, String>())
363369
.build();
364370
mockParticipants.addResponse(expectedResponse);
365371

grpc-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/ParticipantsGrpc.java

Lines changed: 90 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
*
2222
*
2323
* <pre>
24-
* Service for managing [Participants][google.cloud.dialogflow.v2beta1.Participant].
24+
* Service for managing
25+
* [Participants][google.cloud.dialogflow.v2beta1.Participant].
2526
* </pre>
2627
*/
2728
@javax.annotation.Generated(
@@ -549,7 +550,8 @@ public ParticipantsFutureStub newStub(
549550
*
550551
*
551552
* <pre>
552-
* Service for managing [Participants][google.cloud.dialogflow.v2beta1.Participant].
553+
* Service for managing
554+
* [Participants][google.cloud.dialogflow.v2beta1.Participant].
553555
* </pre>
554556
*/
555557
public abstract static class ParticipantsImplBase implements io.grpc.BindableService {
@@ -639,9 +641,12 @@ public void analyzeContent(
639641
* <pre>
640642
* Gets suggested articles for a participant based on specific historical
641643
* messages.
642-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
643-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
644-
* based on the provided conversation context in the real time.
644+
* Note that
645+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
646+
* will only list the auto-generated suggestions, while
647+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
648+
* will try to compile suggestion based on the provided conversation context
649+
* in the real time.
645650
* </pre>
646651
*/
647652
public void suggestArticles(
@@ -690,9 +695,9 @@ public void suggestSmartReplies(
690695
* <pre>
691696
* Deprecated: Use inline suggestion, event based suggestion or
692697
* Suggestion* API instead.
693-
* See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more
694-
* details.
695-
* Removal Date: 2020-09-01.
698+
* See
699+
* [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name]
700+
* for more details. Removal Date: 2020-09-01.
696701
* Retrieves suggestions for live agents.
697702
* This method should be used by human agent client software to fetch auto
698703
* generated suggestions in real-time, while the conversation with an end user
@@ -721,12 +726,19 @@ public void listSuggestions(
721726
*
722727
*
723728
* <pre>
724-
* Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead.
729+
* Deprecated. use
730+
* [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles]
731+
* and
732+
* [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers]
733+
* instead.
725734
* Gets suggestions for a participant based on specific historical
726735
* messages.
727-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
728-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
729-
* based on the provided conversation context in the real time.
736+
* Note that
737+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
738+
* will only list the auto-generated suggestions, while
739+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
740+
* will try to compile suggestion based on the provided conversation context
741+
* in the real time.
730742
* </pre>
731743
*/
732744
@java.lang.Deprecated
@@ -819,7 +831,8 @@ public final io.grpc.ServerServiceDefinition bindService() {
819831
*
820832
*
821833
* <pre>
822-
* Service for managing [Participants][google.cloud.dialogflow.v2beta1.Participant].
834+
* Service for managing
835+
* [Participants][google.cloud.dialogflow.v2beta1.Participant].
823836
* </pre>
824837
*/
825838
public static final class ParticipantsStub
@@ -928,9 +941,12 @@ public void analyzeContent(
928941
* <pre>
929942
* Gets suggested articles for a participant based on specific historical
930943
* messages.
931-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
932-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
933-
* based on the provided conversation context in the real time.
944+
* Note that
945+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
946+
* will only list the auto-generated suggestions, while
947+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
948+
* will try to compile suggestion based on the provided conversation context
949+
* in the real time.
934950
* </pre>
935951
*/
936952
public void suggestArticles(
@@ -985,9 +1001,9 @@ public void suggestSmartReplies(
9851001
* <pre>
9861002
* Deprecated: Use inline suggestion, event based suggestion or
9871003
* Suggestion* API instead.
988-
* See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more
989-
* details.
990-
* Removal Date: 2020-09-01.
1004+
* See
1005+
* [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name]
1006+
* for more details. Removal Date: 2020-09-01.
9911007
* Retrieves suggestions for live agents.
9921008
* This method should be used by human agent client software to fetch auto
9931009
* generated suggestions in real-time, while the conversation with an end user
@@ -1018,12 +1034,19 @@ public void listSuggestions(
10181034
*
10191035
*
10201036
* <pre>
1021-
* Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead.
1037+
* Deprecated. use
1038+
* [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles]
1039+
* and
1040+
* [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers]
1041+
* instead.
10221042
* Gets suggestions for a participant based on specific historical
10231043
* messages.
1024-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
1025-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
1026-
* based on the provided conversation context in the real time.
1044+
* Note that
1045+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
1046+
* will only list the auto-generated suggestions, while
1047+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
1048+
* will try to compile suggestion based on the provided conversation context
1049+
* in the real time.
10271050
* </pre>
10281051
*/
10291052
@java.lang.Deprecated
@@ -1042,7 +1065,8 @@ public void compileSuggestion(
10421065
*
10431066
*
10441067
* <pre>
1045-
* Service for managing [Participants][google.cloud.dialogflow.v2beta1.Participant].
1068+
* Service for managing
1069+
* [Participants][google.cloud.dialogflow.v2beta1.Participant].
10461070
* </pre>
10471071
*/
10481072
public static final class ParticipantsBlockingStub
@@ -1132,9 +1156,12 @@ public com.google.cloud.dialogflow.v2beta1.AnalyzeContentResponse analyzeContent
11321156
* <pre>
11331157
* Gets suggested articles for a participant based on specific historical
11341158
* messages.
1135-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
1136-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
1137-
* based on the provided conversation context in the real time.
1159+
* Note that
1160+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
1161+
* will only list the auto-generated suggestions, while
1162+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
1163+
* will try to compile suggestion based on the provided conversation context
1164+
* in the real time.
11381165
* </pre>
11391166
*/
11401167
public com.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse suggestArticles(
@@ -1177,9 +1204,9 @@ public com.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse suggestSm
11771204
* <pre>
11781205
* Deprecated: Use inline suggestion, event based suggestion or
11791206
* Suggestion* API instead.
1180-
* See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more
1181-
* details.
1182-
* Removal Date: 2020-09-01.
1207+
* See
1208+
* [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name]
1209+
* for more details. Removal Date: 2020-09-01.
11831210
* Retrieves suggestions for live agents.
11841211
* This method should be used by human agent client software to fetch auto
11851212
* generated suggestions in real-time, while the conversation with an end user
@@ -1206,12 +1233,19 @@ public com.google.cloud.dialogflow.v2beta1.ListSuggestionsResponse listSuggestio
12061233
*
12071234
*
12081235
* <pre>
1209-
* Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead.
1236+
* Deprecated. use
1237+
* [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles]
1238+
* and
1239+
* [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers]
1240+
* instead.
12101241
* Gets suggestions for a participant based on specific historical
12111242
* messages.
1212-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
1213-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
1214-
* based on the provided conversation context in the real time.
1243+
* Note that
1244+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
1245+
* will only list the auto-generated suggestions, while
1246+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
1247+
* will try to compile suggestion based on the provided conversation context
1248+
* in the real time.
12151249
* </pre>
12161250
*/
12171251
@java.lang.Deprecated
@@ -1226,7 +1260,8 @@ public com.google.cloud.dialogflow.v2beta1.CompileSuggestionResponse compileSugg
12261260
*
12271261
*
12281262
* <pre>
1229-
* Service for managing [Participants][google.cloud.dialogflow.v2beta1.Participant].
1263+
* Service for managing
1264+
* [Participants][google.cloud.dialogflow.v2beta1.Participant].
12301265
* </pre>
12311266
*/
12321267
public static final class ParticipantsFutureStub
@@ -1321,9 +1356,12 @@ protected ParticipantsFutureStub build(
13211356
* <pre>
13221357
* Gets suggested articles for a participant based on specific historical
13231358
* messages.
1324-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
1325-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
1326-
* based on the provided conversation context in the real time.
1359+
* Note that
1360+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
1361+
* will only list the auto-generated suggestions, while
1362+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
1363+
* will try to compile suggestion based on the provided conversation context
1364+
* in the real time.
13271365
* </pre>
13281366
*/
13291367
public com.google.common.util.concurrent.ListenableFuture<
@@ -1370,9 +1408,9 @@ protected ParticipantsFutureStub build(
13701408
* <pre>
13711409
* Deprecated: Use inline suggestion, event based suggestion or
13721410
* Suggestion* API instead.
1373-
* See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more
1374-
* details.
1375-
* Removal Date: 2020-09-01.
1411+
* See
1412+
* [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name]
1413+
* for more details. Removal Date: 2020-09-01.
13761414
* Retrieves suggestions for live agents.
13771415
* This method should be used by human agent client software to fetch auto
13781416
* generated suggestions in real-time, while the conversation with an end user
@@ -1400,12 +1438,19 @@ protected ParticipantsFutureStub build(
14001438
*
14011439
*
14021440
* <pre>
1403-
* Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead.
1441+
* Deprecated. use
1442+
* [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles]
1443+
* and
1444+
* [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers]
1445+
* instead.
14041446
* Gets suggestions for a participant based on specific historical
14051447
* messages.
1406-
* Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
1407-
* suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
1408-
* based on the provided conversation context in the real time.
1448+
* Note that
1449+
* [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]
1450+
* will only list the auto-generated suggestions, while
1451+
* [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]
1452+
* will try to compile suggestion based on the provided conversation context
1453+
* in the real time.
14091454
* </pre>
14101455
*/
14111456
@java.lang.Deprecated

0 commit comments

Comments
 (0)