Skip to content

Commit ebc5e12

Browse files
Google APIscopybara-github
authored andcommitted
feat: move serving config update API to GA
feat: add time_zone in user info docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 740840314
1 parent 7c5b1c9 commit ebc5e12

6 files changed

Lines changed: 365 additions & 10 deletions

File tree

google/cloud/discoveryengine/v1/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ proto_library(
5454
"schema_service.proto",
5555
"search_service.proto",
5656
"search_tuning_service.proto",
57+
"serving_config.proto",
58+
"serving_config_service.proto",
5759
"session.proto",
5860
"site_search_engine.proto",
5961
"site_search_engine_service.proto",
@@ -158,6 +160,8 @@ java_gapic_test(
158160
"com.google.cloud.discoveryengine.v1.SearchServiceClientTest",
159161
"com.google.cloud.discoveryengine.v1.SearchTuningServiceClientHttpJsonTest",
160162
"com.google.cloud.discoveryengine.v1.SearchTuningServiceClientTest",
163+
"com.google.cloud.discoveryengine.v1.ServingConfigServiceClientHttpJsonTest",
164+
"com.google.cloud.discoveryengine.v1.ServingConfigServiceClientTest",
161165
"com.google.cloud.discoveryengine.v1.SiteSearchEngineServiceClientHttpJsonTest",
162166
"com.google.cloud.discoveryengine.v1.SiteSearchEngineServiceClientTest",
163167
"com.google.cloud.discoveryengine.v1.UserEventServiceClientHttpJsonTest",
@@ -408,6 +412,7 @@ load(
408412

409413
csharp_proto_library(
410414
name = "discoveryengine_csharp_proto",
415+
extra_opts = [],
411416
deps = [":discoveryengine_proto"],
412417
)
413418

google/cloud/discoveryengine/v1/common.proto

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ option (google.api.resource_definition) = {
4040
type: "discoveryengine.googleapis.com/Location"
4141
pattern: "projects/{project}/locations/{location}"
4242
};
43-
option (google.api.resource_definition) = {
44-
type: "discoveryengine.googleapis.com/ServingConfig"
45-
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}"
46-
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
47-
pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}"
48-
};
4943
option (google.api.resource_definition) = {
5044
type: "discoveryengine.googleapis.com/GroundingConfig"
5145
pattern: "projects/{project}/locations/{location}/groundingConfigs/{grounding_config}"
@@ -221,6 +215,9 @@ message UserInfo {
221215
// [UserEvent.direct_user_request][google.cloud.discoveryengine.v1.UserEvent.direct_user_request]
222216
// is set.
223217
string user_agent = 2;
218+
219+
// Optional. IANA time zone, e.g. Europe/Budapest.
220+
string time_zone = 3 [(google.api.field_behavior) = OPTIONAL];
224221
}
225222

226223
// Double list.

google/cloud/discoveryengine/v1/discoveryengine_v1.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ apis:
1717
- name: google.cloud.discoveryengine.v1.SchemaService
1818
- name: google.cloud.discoveryengine.v1.SearchService
1919
- name: google.cloud.discoveryengine.v1.SearchTuningService
20+
- name: google.cloud.discoveryengine.v1.ServingConfigService
2021
- name: google.cloud.discoveryengine.v1.SiteSearchEngineService
2122
- name: google.cloud.discoveryengine.v1.UserEventService
2223
- name: google.cloud.location.Locations
@@ -60,6 +61,7 @@ types:
6061
- name: google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesMetadata
6162
- name: google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesResponse
6263
- name: google.cloud.discoveryengine.v1.Schema
64+
- name: google.cloud.discoveryengine.v1.ServingConfig
6365
- name: google.cloud.discoveryengine.v1.Sitemap
6466
- name: google.cloud.discoveryengine.v1.TargetSite
6567
- name: google.cloud.discoveryengine.v1.TrainCustomModelMetadata
@@ -179,6 +181,10 @@ authentication:
179181
oauth:
180182
canonical_scopes: |-
181183
https://www.googleapis.com/auth/cloud-platform
184+
- selector: google.cloud.discoveryengine.v1.ServingConfigService.UpdateServingConfig
185+
oauth:
186+
canonical_scopes: |-
187+
https://www.googleapis.com/auth/cloud-platform
182188
- selector: 'google.cloud.discoveryengine.v1.SiteSearchEngineService.*'
183189
oauth:
184190
canonical_scopes: |-

google/cloud/discoveryengine/v1/search_service.proto

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ message SearchRequest {
374374
}
375375

376376
// Condition boost specifications. If a document matches multiple conditions
377-
// in the specifictions, boost scores from these specifications are all
377+
// in the specifications, boost scores from these specifications are all
378378
// applied and combined in a non-linear way. Maximum number of
379379
// specifications is 20.
380380
repeated ConditionBoostSpec condition_boost_specs = 1;
@@ -868,9 +868,10 @@ message SearchRequest {
868868
// Default number is 10.
869869
int32 one_box_page_size = 47;
870870

871-
// Specifications that define the specific [DataStore]s to be searched, along
872-
// with configurations for those data stores. This is only considered for
873-
// [Engine][google.cloud.discoveryengine.v1.Engine]s with multiple data
871+
// Specifications that define the specific
872+
// [DataStore][google.cloud.discoveryengine.v1.DataStore]s to be searched,
873+
// along with configurations for those data stores. This is only considered
874+
// for [Engine][google.cloud.discoveryengine.v1.Engine]s with multiple data
874875
// stores. For engines with a single data store, the specs directly under
875876
// [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] should be
876877
// used.
Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
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

Comments
 (0)