@@ -117,6 +117,17 @@ service Conversations {
117117 option (google.api.method_signature ) = "name" ;
118118 }
119119
120+ // Data ingestion API.
121+ // Ingests context references for an existing conversation.
122+ rpc IngestContextReferences (IngestContextReferencesRequest )
123+ returns (IngestContextReferencesResponse ) {
124+ option (google.api.http ) = {
125+ post : "/v2beta1/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences"
126+ body : "*"
127+ };
128+ option (google.api.method_signature ) = "conversation,context_references" ;
129+ }
130+
120131 // Batch ingests messages to conversation. Customers can use this RPC to
121132 // ingest historical messages to conversation.
122133 rpc BatchCreateMessages (BatchCreateMessagesRequest )
@@ -207,6 +218,22 @@ service Conversations {
207218 }
208219 };
209220 }
221+
222+ // Generates all the suggestions using generators configured in the
223+ // conversation profile. A generator is used only if its trigger event is
224+ // matched.
225+ rpc GenerateSuggestions (GenerateSuggestionsRequest )
226+ returns (GenerateSuggestionsResponse ) {
227+ option (google.api.http ) = {
228+ post : "/v2beta1/{conversation=projects/*/conversations/*}/suggestions:generate"
229+ body : "*"
230+ additional_bindings {
231+ post : "/v2beta1/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate"
232+ body : "*"
233+ }
234+ };
235+ option (google.api.method_signature ) = "conversation" ;
236+ }
210237}
211238
212239// Represents a conversation.
@@ -288,6 +315,62 @@ message Conversation {
288315 [(google.api.field_behavior ) = OUTPUT_ONLY ];
289316 }
290317
318+ // Represents a piece of ingested context information.
319+ message ContextReference {
320+ // Contents ingested.
321+ message ContextContent {
322+ // Represents the format of the ingested string.
323+ enum ContentFormat {
324+ // Unspecified content format.
325+ CONTENT_FORMAT_UNSPECIFIED = 0 ;
326+
327+ // Content was provided in JSON format.
328+ JSON = 1 ;
329+
330+ // Content was provided as plain text.
331+ PLAIN_TEXT = 2 ;
332+ }
333+
334+ // Required. The information ingested in a single request.
335+ string content = 1 [(google.api.field_behavior ) = REQUIRED ];
336+
337+ // Required. The format of the ingested string.
338+ ContentFormat content_format = 2 [(google.api.field_behavior ) = REQUIRED ];
339+
340+ // Output only. The time when this information was incorporated into the
341+ // relevant context reference.
342+ google.protobuf.Timestamp ingestion_time = 3
343+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
344+ }
345+
346+ // Represents the mode in which context reference contents are updated.
347+ enum UpdateMode {
348+ // Unspecified update mode.
349+ UPDATE_MODE_UNSPECIFIED = 0 ;
350+
351+ // Context content updates are applied in append mode.
352+ APPEND = 1 ;
353+
354+ // Context content updates are applied in overwrite mode.
355+ OVERWRITE = 2 ;
356+ }
357+
358+ // Required. The list of content updates for a context reference.
359+ repeated ContextContent context_contents = 1
360+ [(google.api.field_behavior ) = REQUIRED ];
361+
362+ // Required. The mode in which context reference contents are updated.
363+ UpdateMode update_mode = 2 [(google.api.field_behavior ) = REQUIRED ];
364+
365+ // Optional. The language of the information ingested, defaults to "en-US"
366+ // if not set.
367+ string language_code = 3 [(google.api.field_behavior ) = OPTIONAL ];
368+
369+ // Output only. The time the context reference was first created.
370+ google.protobuf.Timestamp create_time = 4
371+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
372+ }
373+
291374 // Output only. Identifier. The unique identifier of this conversation.
292375 // Format: `projects/<Project ID>/locations/<Location
293376 // ID>/conversations/<Conversation ID>`.
@@ -346,6 +429,10 @@ message Conversation {
346429 // Output only. The telephony connection information.
347430 TelephonyConnectionInfo telephony_connection_info = 10
348431 [(google.api.field_behavior ) = OUTPUT_ONLY ];
432+
433+ // Output only. The context reference updates provided by external systems.
434+ map <string , ContextReference > ingested_context_references = 17
435+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
349436}
350437
351438// Represents a phone number for telephony integration. It allows for connecting
@@ -545,6 +632,32 @@ message ListMessagesResponse {
545632 string next_page_token = 2 ;
546633}
547634
635+ // The request message for [ConversationsService.IngestContextReferences][].
636+ message IngestContextReferencesRequest {
637+ // Required. Resource identifier of the conversation to ingest context
638+ // information for. Format: `projects/<Project ID>/locations/<Location
639+ // ID>/conversations/<Conversation ID>`.
640+ string conversation = 1 [
641+ (google.api.field_behavior ) = REQUIRED ,
642+ (google.api.resource_reference ) = {
643+ type : "dialogflow.googleapis.com/Conversation"
644+ }
645+ ];
646+
647+ // Required. The context references to ingest. The key is the name of the
648+ // context reference and the value contains the contents of the context
649+ // reference. The key is used to incorporate ingested context references to
650+ // enhance the generator.
651+ map <string , Conversation.ContextReference > context_references = 2
652+ [(google.api.field_behavior ) = REQUIRED ];
653+ }
654+
655+ // The response message for [ConversationsService.IngestContextReferences][].
656+ message IngestContextReferencesResponse {
657+ // All context references ingested.
658+ map <string , Conversation.ContextReference > ingested_context_references = 1 ;
659+ }
660+
548661// The request message for
549662// [Conversations.SuggestConversationSummary][google.cloud.dialogflow.v2beta1.Conversations.SuggestConversationSummary].
550663message SuggestConversationSummaryRequest {
@@ -734,6 +847,13 @@ message GenerateStatelessSuggestionRequest {
734847 string generator_name = 3 ;
735848 }
736849
850+ // Optional. A section of ingested context information. The key is the name of
851+ // the context reference and the value contains the contents of the context
852+ // reference. The key is used to incorporate ingested context references to
853+ // enhance the generator.
854+ map <string , Conversation.ContextReference > context_references = 4
855+ [(google.api.field_behavior ) = OPTIONAL ];
856+
737857 // Optional. Context of the conversation, including transcripts.
738858 ConversationContext conversation_context = 5
739859 [(google.api.field_behavior ) = OPTIONAL ];
@@ -1092,3 +1212,35 @@ message SearchKnowledgeAnswer {
10921212 type : "dialogflow.googleapis.com/AnswerRecord"
10931213 }];
10941214}
1215+
1216+ // The request message for
1217+ // [Conversations.GenerateSuggestions][google.cloud.dialogflow.v2beta1.Conversations.GenerateSuggestions].
1218+ message GenerateSuggestionsRequest {
1219+ // Required. The conversation for which the suggestions are generated. Format:
1220+ // `projects/<Project ID>/locations/<Location
1221+ // ID>/conversations/<Conversation ID>`.
1222+ //
1223+ // The conversation must be created with a conversation profile which has
1224+ // generators configured in it to be able to get suggestions.
1225+ string conversation = 1 [
1226+ (google.api.field_behavior ) = REQUIRED ,
1227+ (google.api.resource_reference ) = {
1228+ type : "dialogflow.googleapis.com/Conversation"
1229+ }
1230+ ];
1231+
1232+ // Optional. The name of the latest conversation message for which the request
1233+ // is triggered. Format: `projects/<Project ID>/locations/<Location
1234+ // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
1235+ string latest_message = 2 [
1236+ (google.api.field_behavior ) = OPTIONAL ,
1237+ (google.api.resource_reference ) = {
1238+ type : "dialogflow.googleapis.com/Message"
1239+ }
1240+ ];
1241+
1242+ // Optional. A list of trigger events. Only generators configured in the
1243+ // conversation_profile whose trigger_event is listed here will be triggered.
1244+ repeated TriggerEvent trigger_events = 3
1245+ [(google.api.field_behavior ) = OPTIONAL ];
1246+ }
0 commit comments