@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121import "google/api/field_behavior.proto" ;
2222import "google/api/resource.proto" ;
2323import "google/cloud/dialogflow/v2/conversation_profile.proto" ;
24+ import "google/cloud/dialogflow/v2/generator.proto" ;
2425import "google/cloud/dialogflow/v2/participant.proto" ;
2526import "google/cloud/dialogflow/v2/session.proto" ;
2627import "google/protobuf/timestamp.proto" ;
@@ -156,6 +157,16 @@ service Conversations {
156157 };
157158 }
158159
160+ // Generates and returns a suggestion for a conversation that does not have a
161+ // resource created for it.
162+ rpc GenerateStatelessSuggestion (GenerateStatelessSuggestionRequest )
163+ returns (GenerateStatelessSuggestionResponse ) {
164+ option (google.api.http ) = {
165+ post : "/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate"
166+ body : "*"
167+ };
168+ }
169+
159170 // Get answers for the given query based on knowledge documents.
160171 rpc SearchKnowledge (SearchKnowledgeRequest )
161172 returns (SearchKnowledgeResponse ) {
@@ -187,6 +198,8 @@ message Conversation {
187198 type : "dialogflow.googleapis.com/Conversation"
188199 pattern : "projects/{project}/conversations/{conversation}"
189200 pattern : "projects/{project}/locations/{location}/conversations/{conversation}"
201+ plural : "conversations"
202+ singular : "conversation"
190203 };
191204
192205 // Enumeration of the completion status of the conversation.
@@ -218,10 +231,13 @@ message Conversation {
218231 HUMAN_ASSIST_STAGE = 2 ;
219232 }
220233
221- // Output only. The unique identifier of this conversation.
234+ // Output only. Identifier. The unique identifier of this conversation.
222235 // Format: `projects/<Project ID>/locations/<Location
223236 // ID>/conversations/<Conversation ID>`.
224- string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
237+ string name = 1 [
238+ (google.api.field_behavior ) = OUTPUT_ONLY ,
239+ (google.api.field_behavior ) = IDENTIFIER
240+ ];
225241
226242 // Output only. The current state of the Conversation.
227243 LifecycleState lifecycle_state = 2
@@ -251,8 +267,8 @@ message Conversation {
251267 google.protobuf.Timestamp end_time = 6
252268 [(google.api.field_behavior ) = OUTPUT_ONLY ];
253269
254- // The stage of a conversation. It indicates whether the virtual agent or a
255- // human agent is handling the conversation.
270+ // Optional. The stage of a conversation. It indicates whether the virtual
271+ // agent or a human agent is handling the conversation.
256272 //
257273 // If the conversation is created with the conversation profile that has
258274 // Dialogflow config set, defaults to
@@ -267,7 +283,8 @@ message Conversation {
267283 // [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]
268284 // stage and directly goes to
269285 // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE].
270- ConversationStage conversation_stage = 7 ;
286+ ConversationStage conversation_stage = 7
287+ [(google.api.field_behavior ) = OPTIONAL ];
271288}
272289
273290// The request message for
@@ -317,24 +334,15 @@ message ListConversationsRequest {
317334 // Optional. The next_page_token value returned from a previous list request.
318335 string page_token = 3 [(google.api.field_behavior ) = OPTIONAL ];
319336
320- // A filter expression that filters conversations listed in the response. In
321- // general, the expression must specify the field name, a comparison operator,
322- // and the value to use for filtering:
323- // <ul>
324- // <li>The value must be a string, a number, or a boolean.</li>
325- // <li>The comparison operator must be either `=`,`!=`, `>`, or `<`.</li>
326- // <li>To filter on multiple expressions, separate the
327- // expressions with `AND` or `OR` (omitting both implies `AND`).</li>
328- // <li>For clarity, expressions can be enclosed in parentheses.</li>
329- // </ul>
330- // Only `lifecycle_state` can be filtered on in this way. For example,
331- // the following expression only returns `COMPLETED` conversations:
337+ // Optional. A filter expression that filters conversations listed in the
338+ // response. Only `lifecycle_state` can be filtered on in this way. For
339+ // example, the following expression only returns `COMPLETED` conversations:
332340 //
333341 // `lifecycle_state = "COMPLETED"`
334342 //
335343 // For more information about filtering, see
336344 // [API Filtering](https://aip.dev/160).
337- string filter = 4 ;
345+ string filter = 4 [ (google.api .field_behavior ) = OPTIONAL ] ;
338346}
339347
340348// The response message for
@@ -441,23 +449,28 @@ message SuggestConversationSummaryRequest {
441449 }
442450 ];
443451
444- // The name of the latest conversation message used as context for
452+ // Optional. The name of the latest conversation message used as context for
445453 // compiling suggestion. If empty, the latest message of the conversation will
446454 // be used.
447455 //
448456 // Format: `projects/<Project ID>/locations/<Location
449457 // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
450- string latest_message = 3 [(google.api.resource_reference ) = {
451- type : "dialogflow.googleapis.com/Message"
452- }];
458+ string latest_message = 3 [
459+ (google.api.field_behavior ) = OPTIONAL ,
460+ (google.api.resource_reference ) = {
461+ type : "dialogflow.googleapis.com/Message"
462+ }
463+ ];
453464
454- // Max number of messages prior to and including
465+ // Optional. Max number of messages prior to and including
455466 // [latest_message] to use as context when compiling the
456467 // suggestion. By default 500 and at most 1000.
457- int32 context_size = 4 ;
468+ int32 context_size = 4 [ (google.api .field_behavior ) = OPTIONAL ] ;
458469
459- // Parameters for a human assist query. Only used for POC/demo purpose.
460- AssistQueryParameters assist_query_params = 5 ;
470+ // Optional. Parameters for a human assist query. Only used for POC/demo
471+ // purpose.
472+ AssistQueryParameters assist_query_params = 5
473+ [(google.api.field_behavior ) = OPTIONAL ];
461474}
462475
463476// The response message for
@@ -537,18 +550,21 @@ message GenerateStatelessSummaryRequest {
537550 ConversationProfile conversation_profile = 2
538551 [(google.api.field_behavior ) = REQUIRED ];
539552
540- // The name of the latest conversation message used as context for
553+ // Optional. The name of the latest conversation message used as context for
541554 // generating a Summary. If empty, the latest message of the conversation will
542555 // be used. The format is specific to the user and the names of the messages
543556 // provided.
544- string latest_message = 3 [(google.api.resource_reference ) = {
545- type : "dialogflow.googleapis.com/Message"
546- }];
557+ string latest_message = 3 [
558+ (google.api.field_behavior ) = OPTIONAL ,
559+ (google.api.resource_reference ) = {
560+ type : "dialogflow.googleapis.com/Message"
561+ }
562+ ];
547563
548- // Max number of messages prior to and including
564+ // Optional. Max number of messages prior to and including
549565 // [latest_message] to use as context when compiling the
550566 // suggestion. By default 500 and at most 1000.
551- int32 max_context_size = 4 ;
567+ int32 max_context_size = 4 [ (google.api .field_behavior ) = OPTIONAL ] ;
552568}
553569
554570// The response message for
@@ -586,13 +602,54 @@ message GenerateStatelessSummaryResponse {
586602 int32 context_size = 3 ;
587603}
588604
605+ // The request message for
606+ // [Conversations.GenerateStatelessSuggestion][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion].
607+ message GenerateStatelessSuggestionRequest {
608+ // Required. The parent resource to charge for the Suggestion's generation.
609+ // Format: `projects/<Project ID>/locations/<Location ID>`.
610+ string parent = 1 [
611+ (google.api.field_behavior ) = REQUIRED ,
612+ (google.api.resource_reference ) = {
613+ type : "locations.googleapis.com/Location"
614+ }
615+ ];
616+
617+ // Generator.
618+ oneof generator_resource {
619+ // Uncreated generator. It should be a complete generator that includes all
620+ // information about the generator.
621+ Generator generator = 2 ;
622+
623+ // The resource name of the existing created generator. Format:
624+ // `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
625+ string generator_name = 3 ;
626+ }
627+
628+ // Optional. Context of the conversation, including transcripts.
629+ ConversationContext conversation_context = 5
630+ [(google.api.field_behavior ) = OPTIONAL ];
631+
632+ // Optional. A list of trigger events. Generator will be triggered only if
633+ // it's trigger event is included here.
634+ repeated TriggerEvent trigger_events = 6
635+ [(google.api.field_behavior ) = OPTIONAL ];
636+ }
637+
638+ // The response message for
639+ // [Conversations.GenerateStatelessSuggestion][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion].
640+ message GenerateStatelessSuggestionResponse {
641+ // Required. Generated suggestion for a conversation.
642+ GeneratorSuggestion generator_suggestion = 1
643+ [(google.api.field_behavior ) = REQUIRED ];
644+ }
645+
589646// The request message for
590647// [Conversations.SearchKnowledge][google.cloud.dialogflow.v2.Conversations.SearchKnowledge].
591648message SearchKnowledgeRequest {
592- // The parent resource contains the conversation profile
649+ // Required. The parent resource contains the conversation profile
593650 // Format: 'projects/<Project ID>' or `projects/<Project
594651 // ID>/locations/<Location ID>`.
595- string parent = 6 ;
652+ string parent = 6 [ (google.api .field_behavior ) = REQUIRED ] ;
596653
597654 // Required. The natural language text query for knowledge search.
598655 TextInput query = 1 [(google.api.field_behavior ) = REQUIRED ];
@@ -607,29 +664,35 @@ message SearchKnowledgeRequest {
607664 }
608665 ];
609666
610- // The ID of the search session.
667+ // Required. The ID of the search session.
611668 // The session_id can be combined with Dialogflow V3 Agent ID retrieved from
612669 // conversation profile or on its own to identify a search session. The search
613670 // history of the same session will impact the search result. It's up to the
614671 // API caller to choose an appropriate `Session ID`. It can be a random number
615672 // or some type of session identifiers (preferably hashed). The length must
616673 // not exceed 36 characters.
617- string session_id = 3 ;
674+ string session_id = 3 [ (google.api .field_behavior ) = REQUIRED ] ;
618675
619- // The conversation (between human agent and end user) where the search
620- // request is triggered. Format: `projects/<Project ID>/locations/<Location
621- // ID>/conversations/<Conversation ID>`.
622- string conversation = 4 [(google.api.resource_reference ) = {
623- type : "dialogflow.googleapis.com/Conversation"
624- }];
676+ // Optional. The conversation (between human agent and end user) where the
677+ // search request is triggered. Format: `projects/<Project
678+ // ID>/locations/<Location ID>/conversations/<Conversation ID>`.
679+ string conversation = 4 [
680+ (google.api.field_behavior ) = OPTIONAL ,
681+ (google.api.resource_reference ) = {
682+ type : "dialogflow.googleapis.com/Conversation"
683+ }
684+ ];
625685
626- // The name of the latest conversation message when the request is
686+ // Optional. The name of the latest conversation message when the request is
627687 // triggered.
628688 // Format: `projects/<Project ID>/locations/<Location
629689 // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
630- string latest_message = 5 [(google.api.resource_reference ) = {
631- type : "dialogflow.googleapis.com/Message"
632- }];
690+ string latest_message = 5 [
691+ (google.api.field_behavior ) = OPTIONAL ,
692+ (google.api.resource_reference ) = {
693+ type : "dialogflow.googleapis.com/Message"
694+ }
695+ ];
633696}
634697
635698// The response message for
0 commit comments