@@ -27,6 +27,7 @@ import "google/cloud/dialogflow/cx/v3/page.proto";
2727import "google/cloud/dialogflow/cx/v3/response_message.proto" ;
2828import "google/cloud/dialogflow/cx/v3/session_entity_type.proto" ;
2929import "google/protobuf/duration.proto" ;
30+ import "google/protobuf/field_mask.proto" ;
3031import "google/protobuf/struct.proto" ;
3132import "google/rpc/status.proto" ;
3233import "google/type/latlng.proto" ;
@@ -44,6 +45,11 @@ option (google.api.resource_definition) = {
4445 pattern : "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}"
4546 pattern : "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}"
4647};
48+ option (google.api.resource_definition ) = {
49+ type : "discoveryengine.googleapis.com/DataStore"
50+ pattern : "projects/{project}/locations/{location}/dataStores/{data_store}"
51+ pattern : "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}"
52+ };
4753
4854// A session represents an interaction with a user. You retrieve user input
4955// and pass it to the
@@ -114,6 +120,78 @@ service Sessions {
114120 }
115121 };
116122 }
123+
124+ // Updates the feedback received from the user for a single turn of the bot
125+ // response.
126+ rpc SubmitAnswerFeedback (SubmitAnswerFeedbackRequest )
127+ returns (AnswerFeedback ) {
128+ option (google.api.http ) = {
129+ post : "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback"
130+ body : "*"
131+ };
132+ }
133+ }
134+
135+ // Stores information about feedback provided by users about a response.
136+ message AnswerFeedback {
137+ // Represents thumbs up/down rating provided by user about a response.
138+ enum Rating {
139+ // Rating not specified.
140+ RATING_UNSPECIFIED = 0 ;
141+
142+ // Thumbs up feedback from user.
143+ THUMBS_UP = 1 ;
144+
145+ // Thumbs down feedback from user.
146+ THUMBS_DOWN = 2 ;
147+ }
148+
149+ // Stores extra information about why users provided thumbs down rating.
150+ message RatingReason {
151+ // Optional. Custom reason labels for thumbs down rating provided by the
152+ // user. The maximum number of labels allowed is 10 and the maximum length
153+ // of a single label is 128 characters.
154+ repeated string reason_labels = 3 [(google.api.field_behavior ) = OPTIONAL ];
155+
156+ // Optional. Additional feedback about the rating.
157+ // This field can be populated without choosing a predefined `reason`.
158+ string feedback = 2 [(google.api.field_behavior ) = OPTIONAL ];
159+ }
160+
161+ // Optional. Rating from user for the specific Dialogflow response.
162+ Rating rating = 1 [(google.api.field_behavior ) = OPTIONAL ];
163+
164+ // Optional. In case of thumbs down rating provided, users can optionally
165+ // provide context about the rating.
166+ RatingReason rating_reason = 2 [(google.api.field_behavior ) = OPTIONAL ];
167+
168+ // Optional. Custom rating from the user about the provided answer, with
169+ // maximum length of 1024 characters. For example, client could use a
170+ // customized JSON object to indicate the rating.
171+ string custom_rating = 3 [(google.api.field_behavior ) = OPTIONAL ];
172+ }
173+
174+ // The request to set the feedback for a bot answer.
175+ message SubmitAnswerFeedbackRequest {
176+ // Required. The name of the session the feedback was sent to.
177+ string session = 1 [
178+ (google.api.field_behavior ) = REQUIRED ,
179+ (google.api.resource_reference ) = {
180+ type : "dialogflow.googleapis.com/Session"
181+ }
182+ ];
183+
184+ // Required. ID of the response to update its feedback. This is the same as
185+ // DetectIntentResponse.response_id.
186+ string response_id = 2 [(google.api.field_behavior ) = REQUIRED ];
187+
188+ // Required. Feedback provided for a bot answer.
189+ AnswerFeedback answer_feedback = 3 [(google.api.field_behavior ) = REQUIRED ];
190+
191+ // Optional. The mask to control which fields to update. If the mask is not
192+ // present, all fields will be updated.
193+ google.protobuf.FieldMask update_mask = 4
194+ [(google.api.field_behavior ) = OPTIONAL ];
117195}
118196
119197// The request to detect user's intent.
@@ -607,6 +685,120 @@ message QueryParameters {
607685 // This value should be no longer than 1 day.
608686 google.protobuf.Duration session_ttl = 16
609687 [(google.api.field_behavior ) = OPTIONAL ];
688+
689+ // Optional. Information about the end-user to improve the relevance and
690+ // accuracy of generative answers.
691+ //
692+ // This will be interpreted and used by a language model, so, for good
693+ // results, the data should be self-descriptive, and in a simple structure.
694+ //
695+ // Example:
696+ //
697+ // ```json
698+ // {
699+ // "subscription plan": "Business Premium Plus",
700+ // "devices owned": [
701+ // {"model": "Google Pixel 7"},
702+ // {"model": "Google Pixel Tablet"}
703+ // ]
704+ // }
705+ // ```
706+ google.protobuf.Struct end_user_metadata = 18
707+ [(google.api.field_behavior ) = OPTIONAL ];
708+
709+ // Optional. Search configuration for UCS search queries.
710+ SearchConfig search_config = 20 [(google.api.field_behavior ) = OPTIONAL ];
711+ }
712+
713+ // Search configuration for UCS search queries.
714+ message SearchConfig {
715+ // Optional. Boosting configuration for the datastores.
716+ repeated BoostSpecs boost_specs = 1 [(google.api.field_behavior ) = OPTIONAL ];
717+
718+ // Optional. Filter configuration for the datastores.
719+ repeated FilterSpecs filter_specs = 2
720+ [(google.api.field_behavior ) = OPTIONAL ];
721+ }
722+
723+ // Boost specification to boost certain documents.
724+ // A copy of google.cloud.discoveryengine.v1main.BoostSpec, field documentation
725+ // is available at
726+ // https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec
727+ message BoostSpec {
728+ // Boost applies to documents which match a condition.
729+ message ConditionBoostSpec {
730+ // Optional. An expression which specifies a boost condition. The syntax and
731+ // supported fields are the same as a filter expression.
732+ // Examples:
733+ //
734+ // * To boost documents with document ID "doc_1" or "doc_2", and
735+ // color
736+ // "Red" or "Blue":
737+ // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
738+ string condition = 1 [(google.api.field_behavior ) = OPTIONAL ];
739+
740+ // Optional. Strength of the condition boost, which should be in [-1, 1].
741+ // Negative boost means demotion. Default is 0.0.
742+ //
743+ // Setting to 1.0 gives the document a big promotion. However, it does not
744+ // necessarily mean that the boosted document will be the top result at
745+ // all times, nor that other documents will be excluded. Results could
746+ // still be shown even when none of them matches the condition. And
747+ // results that are significantly more relevant to the search query can
748+ // still trump your heavily favored but irrelevant documents.
749+ //
750+ // Setting to -1.0 gives the document a big demotion. However, results
751+ // that are deeply relevant might still be shown. The document will have
752+ // an upstream battle to get a fairly high ranking, but it is not blocked
753+ // out completely.
754+ //
755+ // Setting to 0.0 means no boost applied. The boosting condition is
756+ // ignored.
757+ float boost = 2 [(google.api.field_behavior ) = OPTIONAL ];
758+ }
759+
760+ // Optional. Condition boost specifications. If a document matches multiple
761+ // conditions in the specifictions, boost scores from these specifications are
762+ // all applied and combined in a non-linear way. Maximum number of
763+ // specifications is 20.
764+ repeated ConditionBoostSpec condition_boost_specs = 1
765+ [(google.api.field_behavior ) = OPTIONAL ];
766+ }
767+
768+ // Boost specifications for data stores.
769+ message BoostSpecs {
770+ // Optional. Data Stores where the boosting configuration is applied. The full
771+ // names of the referenced data stores. Formats:
772+ // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
773+ // `projects/{project}/locations/{location}/dataStores/{data_store}
774+ repeated string data_stores = 1 [
775+ (google.api.field_behavior ) = OPTIONAL ,
776+ (google.api.resource_reference ) = {
777+ type : "discoveryengine.googleapis.com/DataStore"
778+ }
779+ ];
780+
781+ // Optional. A list of boosting specifications.
782+ repeated BoostSpec spec = 2 [(google.api.field_behavior ) = OPTIONAL ];
783+ }
784+
785+ // Filter specifications for data stores.
786+ message FilterSpecs {
787+ // Optional. Data Stores where the boosting configuration is applied. The full
788+ // names of the referenced data stores. Formats:
789+ // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
790+ // `projects/{project}/locations/{location}/dataStores/{data_store}
791+ repeated string data_stores = 1 [
792+ (google.api.field_behavior ) = OPTIONAL ,
793+ (google.api.resource_reference ) = {
794+ type : "discoveryengine.googleapis.com/DataStore"
795+ }
796+ ];
797+
798+ // Optional. The filter expression to be applied.
799+ // Expression syntax is documented at
800+ // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax
801+ string filter = 2 [(google.api.field_behavior ) = OPTIONAL ];
610802}
611803
612804// Represents the query input. It can contain one of:
@@ -772,6 +964,10 @@ message QueryResult {
772964 // Dialogflow exports audio to Google Cloud Storage, then the client may need
773965 // to wait for the resulting object to appear in the bucket before proceeding.
774966 AdvancedSettings advanced_settings = 21 ;
967+
968+ // Indicates whether the Thumbs up/Thumbs down rating controls are need to be
969+ // shown for the response in the Dialogflow Messenger widget.
970+ bool allow_answer_feedback = 32 ;
775971}
776972
777973// Represents the natural language text to be processed.
0 commit comments