@@ -27,6 +27,7 @@ import "google/cloud/dialogflow/cx/v3beta1/page.proto";
2727import "google/cloud/dialogflow/cx/v3beta1/response_message.proto" ;
2828import "google/cloud/dialogflow/cx/v3beta1/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 : "/v3beta1/{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.
@@ -609,6 +687,120 @@ message QueryParameters {
609687 // This value should be no longer than 1 day.
610688 google.protobuf.Duration session_ttl = 16
611689 [(google.api.field_behavior ) = OPTIONAL ];
690+
691+ // Optional. Information about the end-user to improve the relevance and
692+ // accuracy of generative answers.
693+ //
694+ // This will be interpreted and used by a language model, so, for good
695+ // results, the data should be self-descriptive, and in a simple structure.
696+ //
697+ // Example:
698+ //
699+ // ```json
700+ // {
701+ // "subscription plan": "Business Premium Plus",
702+ // "devices owned": [
703+ // {"model": "Google Pixel 7"},
704+ // {"model": "Google Pixel Tablet"}
705+ // ]
706+ // }
707+ // ```
708+ google.protobuf.Struct end_user_metadata = 18
709+ [(google.api.field_behavior ) = OPTIONAL ];
710+
711+ // Optional. Search configuration for UCS search queries.
712+ SearchConfig search_config = 20 [(google.api.field_behavior ) = OPTIONAL ];
713+ }
714+
715+ // Search configuration for UCS search queries.
716+ message SearchConfig {
717+ // Optional. Boosting configuration for the datastores.
718+ repeated BoostSpecs boost_specs = 1 [(google.api.field_behavior ) = OPTIONAL ];
719+
720+ // Optional. Filter configuration for the datastores.
721+ repeated FilterSpecs filter_specs = 2
722+ [(google.api.field_behavior ) = OPTIONAL ];
723+ }
724+
725+ // Boost specification to boost certain documents.
726+ // A copy of google.cloud.discoveryengine.v1main.BoostSpec, field documentation
727+ // is available at
728+ // https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec
729+ message BoostSpec {
730+ // Boost applies to documents which match a condition.
731+ message ConditionBoostSpec {
732+ // Optional. An expression which specifies a boost condition. The syntax and
733+ // supported fields are the same as a filter expression.
734+ // Examples:
735+ //
736+ // * To boost documents with document ID "doc_1" or "doc_2", and
737+ // color
738+ // "Red" or "Blue":
739+ // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
740+ string condition = 1 [(google.api.field_behavior ) = OPTIONAL ];
741+
742+ // Optional. Strength of the condition boost, which should be in [-1, 1].
743+ // Negative boost means demotion. Default is 0.0.
744+ //
745+ // Setting to 1.0 gives the document a big promotion. However, it does not
746+ // necessarily mean that the boosted document will be the top result at
747+ // all times, nor that other documents will be excluded. Results could
748+ // still be shown even when none of them matches the condition. And
749+ // results that are significantly more relevant to the search query can
750+ // still trump your heavily favored but irrelevant documents.
751+ //
752+ // Setting to -1.0 gives the document a big demotion. However, results
753+ // that are deeply relevant might still be shown. The document will have
754+ // an upstream battle to get a fairly high ranking, but it is not blocked
755+ // out completely.
756+ //
757+ // Setting to 0.0 means no boost applied. The boosting condition is
758+ // ignored.
759+ float boost = 2 [(google.api.field_behavior ) = OPTIONAL ];
760+ }
761+
762+ // Optional. Condition boost specifications. If a document matches multiple
763+ // conditions in the specifictions, boost scores from these specifications are
764+ // all applied and combined in a non-linear way. Maximum number of
765+ // specifications is 20.
766+ repeated ConditionBoostSpec condition_boost_specs = 1
767+ [(google.api.field_behavior ) = OPTIONAL ];
768+ }
769+
770+ // Boost specifications for data stores.
771+ message BoostSpecs {
772+ // Optional. Data Stores where the boosting configuration is applied. The full
773+ // names of the referenced data stores. Formats:
774+ // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
775+ // `projects/{project}/locations/{location}/dataStores/{data_store}
776+ repeated string data_stores = 1 [
777+ (google.api.field_behavior ) = OPTIONAL ,
778+ (google.api.resource_reference ) = {
779+ type : "discoveryengine.googleapis.com/DataStore"
780+ }
781+ ];
782+
783+ // Optional. A list of boosting specifications.
784+ repeated BoostSpec spec = 2 [(google.api.field_behavior ) = OPTIONAL ];
785+ }
786+
787+ // Filter specifications for data stores.
788+ message FilterSpecs {
789+ // Optional. Data Stores where the boosting configuration is applied. The full
790+ // names of the referenced data stores. Formats:
791+ // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
792+ // `projects/{project}/locations/{location}/dataStores/{data_store}
793+ repeated string data_stores = 1 [
794+ (google.api.field_behavior ) = OPTIONAL ,
795+ (google.api.resource_reference ) = {
796+ type : "discoveryengine.googleapis.com/DataStore"
797+ }
798+ ];
799+
800+ // Optional. The filter expression to be applied.
801+ // Expression syntax is documented at
802+ // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax
803+ string filter = 2 [(google.api.field_behavior ) = OPTIONAL ];
612804}
613805
614806// Represents the query input. It can contain one of:
@@ -774,6 +966,10 @@ message QueryResult {
774966 // Dialogflow exports audio to Google Cloud Storage, then the client may need
775967 // to wait for the resulting object to appear in the bucket before proceeding.
776968 AdvancedSettings advanced_settings = 21 ;
969+
970+ // Indicates whether the Thumbs up/Thumbs down rating controls are need to be
971+ // shown for the response in the Dialogflow Messenger widget.
972+ bool allow_answer_feedback = 32 ;
777973}
778974
779975// Represents the natural language text to be processed.
0 commit comments