|
| 1 | +// Copyright 2025 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.discoveryengine.v1; |
| 18 | + |
| 19 | +import "google/api/field_behavior.proto"; |
| 20 | +import "google/api/resource.proto"; |
| 21 | +import "google/cloud/discoveryengine/v1/common.proto"; |
| 22 | +import "google/cloud/discoveryengine/v1/search_service.proto"; |
| 23 | +import "google/protobuf/timestamp.proto"; |
| 24 | + |
| 25 | +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; |
| 26 | +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; |
| 27 | +option java_multiple_files = true; |
| 28 | +option java_outer_classname = "ServingConfigProto"; |
| 29 | +option java_package = "com.google.cloud.discoveryengine.v1"; |
| 30 | +option objc_class_prefix = "DISCOVERYENGINE"; |
| 31 | +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; |
| 32 | +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; |
| 33 | + |
| 34 | +// Configures metadata that is used to generate serving time results (e.g. |
| 35 | +// search results or recommendation predictions). |
| 36 | +// The ServingConfig is passed in the search and predict request and generates |
| 37 | +// results. |
| 38 | +message ServingConfig { |
| 39 | + option (google.api.resource) = { |
| 40 | + type: "discoveryengine.googleapis.com/ServingConfig" |
| 41 | + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}" |
| 42 | + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}" |
| 43 | + pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}" |
| 44 | + }; |
| 45 | + |
| 46 | + // Specifies the configurations needed for Media Discovery. Currently we |
| 47 | + // support: |
| 48 | + // |
| 49 | + // * `demote_content_watched`: Threshold for watched content demotion. |
| 50 | + // Customers can specify if using watched content demotion or use viewed |
| 51 | + // detail page. Using the content watched demotion, customers need to specify |
| 52 | + // the watched minutes or percentage exceeds the threshold, the content will |
| 53 | + // be demoted in the recommendation result. |
| 54 | + // * `promote_fresh_content`: cutoff days for fresh content promotion. |
| 55 | + // Customers can specify if using content freshness promotion. If the content |
| 56 | + // was published within the cutoff days, the content will be promoted in the |
| 57 | + // recommendation result. |
| 58 | + // Can only be set if |
| 59 | + // [SolutionType][google.cloud.discoveryengine.v1.SolutionType] is |
| 60 | + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. |
| 61 | + message MediaConfig { |
| 62 | + // Specify the threshold for demoting watched content, the threshold can be |
| 63 | + // either percentage or minutes value. |
| 64 | + // This must be set for `media-complete` event type. |
| 65 | + oneof demote_content_watched { |
| 66 | + // Specifies the content watched percentage threshold for demotion. |
| 67 | + // Threshold value must be between [0, 1.0] inclusive. |
| 68 | + float content_watched_percentage_threshold = 2; |
| 69 | + |
| 70 | + // Specifies the content watched minutes threshold for demotion. |
| 71 | + float content_watched_seconds_threshold = 5; |
| 72 | + } |
| 73 | + |
| 74 | + // Specifies the event type used for demoting recommendation result. |
| 75 | + // Currently supported values: |
| 76 | + // |
| 77 | + // * `view-item`: Item viewed. |
| 78 | + // * `media-play`: Start/resume watching a video, playing a song, etc. |
| 79 | + // * `media-complete`: Finished or stopped midway through a video, song, |
| 80 | + // etc. |
| 81 | + // |
| 82 | + // If unset, watch history demotion will not be applied. Content freshness |
| 83 | + // demotion will still be applied. |
| 84 | + string demotion_event_type = 1; |
| 85 | + |
| 86 | + // Optional. Specifies the number of days to look back for demoting watched |
| 87 | + // content. If set to zero or unset, defaults to the maximum of 365 days. |
| 88 | + int32 demote_content_watched_past_days = 37 |
| 89 | + [(google.api.field_behavior) = OPTIONAL]; |
| 90 | + |
| 91 | + // Specifies the content freshness used for recommendation result. |
| 92 | + // Contents will be demoted if contents were published for more than content |
| 93 | + // freshness cutoff days. |
| 94 | + int32 content_freshness_cutoff_days = 4; |
| 95 | + } |
| 96 | + |
| 97 | + // Specifies the configurations needed for Generic Discovery.Currently we |
| 98 | + // support: |
| 99 | + // |
| 100 | + // * `content_search_spec`: configuration for generic content search. |
| 101 | + message GenericConfig { |
| 102 | + // Specifies the expected behavior of content search. |
| 103 | + // Only valid for content-search enabled data store. |
| 104 | + SearchRequest.ContentSearchSpec content_search_spec = 1; |
| 105 | + } |
| 106 | + |
| 107 | + // Industry vertical specific config. |
| 108 | + oneof vertical_config { |
| 109 | + // The MediaConfig of the serving configuration. |
| 110 | + MediaConfig media_config = 7; |
| 111 | + |
| 112 | + // The GenericConfig of the serving configuration. |
| 113 | + GenericConfig generic_config = 10; |
| 114 | + } |
| 115 | + |
| 116 | + // Immutable. Fully qualified name |
| 117 | + // `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` |
| 118 | + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; |
| 119 | + |
| 120 | + // Required. The human readable serving config display name. Used in Discovery |
| 121 | + // UI. |
| 122 | + // |
| 123 | + // This field must be a UTF-8 encoded string with a length limit of 128 |
| 124 | + // characters. Otherwise, an INVALID_ARGUMENT error is returned. |
| 125 | + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; |
| 126 | + |
| 127 | + // Required. Immutable. Specifies the solution type that a serving config can |
| 128 | + // be associated with. |
| 129 | + SolutionType solution_type = 3 [ |
| 130 | + (google.api.field_behavior) = REQUIRED, |
| 131 | + (google.api.field_behavior) = IMMUTABLE |
| 132 | + ]; |
| 133 | + |
| 134 | + // The id of the model to use at serving time. |
| 135 | + // Currently only RecommendationModels are supported. |
| 136 | + // Can be changed but only to a compatible model (e.g. |
| 137 | + // others-you-may-like CTR to others-you-may-like CVR). |
| 138 | + // |
| 139 | + // Required when [SolutionType][google.cloud.discoveryengine.v1.SolutionType] |
| 140 | + // is |
| 141 | + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. |
| 142 | + string model_id = 4; |
| 143 | + |
| 144 | + // How much diversity to use in recommendation model results e.g. |
| 145 | + // `medium-diversity` or `high-diversity`. Currently supported values: |
| 146 | + // |
| 147 | + // * `no-diversity` |
| 148 | + // * `low-diversity` |
| 149 | + // * `medium-diversity` |
| 150 | + // * `high-diversity` |
| 151 | + // * `auto-diversity` |
| 152 | + // |
| 153 | + // If not specified, we choose default based on recommendation model |
| 154 | + // type. Default value: `no-diversity`. |
| 155 | + // |
| 156 | + // Can only be set if |
| 157 | + // [SolutionType][google.cloud.discoveryengine.v1.SolutionType] is |
| 158 | + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. |
| 159 | + string diversity_level = 5; |
| 160 | + |
| 161 | + // The ranking expression controls the customized ranking on retrieval |
| 162 | + // documents. To leverage this, document embedding is required. The ranking |
| 163 | + // expression setting in ServingConfig applies to all search requests served |
| 164 | + // by the serving config. However, if `SearchRequest.ranking_expression` is |
| 165 | + // specified, it overrides the ServingConfig ranking expression. |
| 166 | + // |
| 167 | + // The ranking expression is a single function or multiple functions that are |
| 168 | + // joined by "+". |
| 169 | + // |
| 170 | + // * ranking_expression = function, { " + ", function }; |
| 171 | + // |
| 172 | + // Supported functions: |
| 173 | + // |
| 174 | + // * double * relevance_score |
| 175 | + // * double * dotProduct(embedding_field_path) |
| 176 | + // |
| 177 | + // Function variables: |
| 178 | + // |
| 179 | + // * `relevance_score`: pre-defined keywords, used for measure relevance |
| 180 | + // between query and document. |
| 181 | + // * `embedding_field_path`: the document embedding field |
| 182 | + // used with query embedding vector. |
| 183 | + // * `dotProduct`: embedding function between embedding_field_path and query |
| 184 | + // embedding vector. |
| 185 | + // |
| 186 | + // Example ranking expression: |
| 187 | + // |
| 188 | + // If document has an embedding field doc_embedding, the ranking expression |
| 189 | + // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`. |
| 190 | + string ranking_expression = 21; |
| 191 | + |
| 192 | + // Output only. ServingConfig created timestamp. |
| 193 | + google.protobuf.Timestamp create_time = 8 |
| 194 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 195 | + |
| 196 | + // Output only. ServingConfig updated timestamp. |
| 197 | + google.protobuf.Timestamp update_time = 9 |
| 198 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 199 | + |
| 200 | + // Filter controls to use in serving path. |
| 201 | + // All triggered filter controls will be applied. |
| 202 | + // Filter controls must be in the same data store as the serving config. |
| 203 | + // Maximum of 20 filter controls. |
| 204 | + repeated string filter_control_ids = 11; |
| 205 | + |
| 206 | + // Boost controls to use in serving path. |
| 207 | + // All triggered boost controls will be applied. |
| 208 | + // Boost controls must be in the same data store as the serving config. |
| 209 | + // Maximum of 20 boost controls. |
| 210 | + repeated string boost_control_ids = 12; |
| 211 | + |
| 212 | + // IDs of the redirect controls. Only the first triggered redirect |
| 213 | + // action is applied, even if multiple apply. Maximum number of |
| 214 | + // specifications is 100. |
| 215 | + // |
| 216 | + // Can only be set if |
| 217 | + // [SolutionType][google.cloud.discoveryengine.v1.SolutionType] is |
| 218 | + // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. |
| 219 | + repeated string redirect_control_ids = 14; |
| 220 | + |
| 221 | + // Condition synonyms specifications. If multiple synonyms conditions |
| 222 | + // match, all matching synonyms controls in the list will execute. |
| 223 | + // Maximum number of specifications is 100. |
| 224 | + // |
| 225 | + // Can only be set if |
| 226 | + // [SolutionType][google.cloud.discoveryengine.v1.SolutionType] is |
| 227 | + // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. |
| 228 | + repeated string synonyms_control_ids = 15; |
| 229 | + |
| 230 | + // Condition oneway synonyms specifications. If multiple oneway synonyms |
| 231 | + // conditions match, all matching oneway synonyms controls in the list |
| 232 | + // will execute. Maximum number of specifications is 100. |
| 233 | + // |
| 234 | + // Can only be set if |
| 235 | + // [SolutionType][google.cloud.discoveryengine.v1.SolutionType] is |
| 236 | + // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. |
| 237 | + repeated string oneway_synonyms_control_ids = 16; |
| 238 | + |
| 239 | + // Condition do not associate specifications. If multiple do not |
| 240 | + // associate conditions match, all matching do not associate controls in |
| 241 | + // the list will execute. |
| 242 | + // Order does not matter. |
| 243 | + // Maximum number of specifications is 100. |
| 244 | + // |
| 245 | + // Can only be set if |
| 246 | + // [SolutionType][google.cloud.discoveryengine.v1.SolutionType] is |
| 247 | + // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. |
| 248 | + repeated string dissociate_control_ids = 17; |
| 249 | + |
| 250 | + // Condition replacement specifications. |
| 251 | + // Applied according to the order in the list. |
| 252 | + // A previously replaced term can not be re-replaced. |
| 253 | + // Maximum number of specifications is 100. |
| 254 | + // |
| 255 | + // Can only be set if |
| 256 | + // [SolutionType][google.cloud.discoveryengine.v1.SolutionType] is |
| 257 | + // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. |
| 258 | + repeated string replacement_control_ids = 18; |
| 259 | + |
| 260 | + // Condition ignore specifications. If multiple ignore |
| 261 | + // conditions match, all matching ignore controls in the list will |
| 262 | + // execute. |
| 263 | + // Order does not matter. |
| 264 | + // Maximum number of specifications is 100. |
| 265 | + repeated string ignore_control_ids = 19; |
| 266 | + |
| 267 | + // Condition promote specifications. |
| 268 | + // |
| 269 | + // Maximum number of specifications is 100. |
| 270 | + repeated string promote_control_ids = 26; |
| 271 | +} |
0 commit comments