xref: /aosp_15_r20/external/googleapis/google/cloud/discoveryengine/v1alpha/engine.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 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
15syntax = "proto3";
16
17package google.cloud.discoveryengine.v1alpha;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/discoveryengine/v1alpha/common.proto";
22import "google/protobuf/timestamp.proto";
23
24option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
25option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
26option java_multiple_files = true;
27option java_outer_classname = "EngineProto";
28option java_package = "com.google.cloud.discoveryengine.v1alpha";
29option objc_class_prefix = "DISCOVERYENGINE";
30option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
31option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
32
33// Metadata that describes the training and serving parameters of an
34// [Engine][google.cloud.discoveryengine.v1alpha.Engine].
35message Engine {
36  option (google.api.resource) = {
37    type: "discoveryengine.googleapis.com/Engine"
38    pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}"
39  };
40
41  // Configurations for a Search Engine.
42  message SearchEngineConfig {
43    // The search feature tier of this engine.
44    //
45    // Different tiers might have different
46    // pricing. To learn more, check the pricing documentation.
47    //
48    // Defaults to
49    // [SearchTier.SEARCH_TIER_STANDARD][google.cloud.discoveryengine.v1alpha.SearchTier.SEARCH_TIER_STANDARD]
50    // if not specified.
51    SearchTier search_tier = 1;
52
53    // The add-on that this search engine enables.
54    repeated SearchAddOn search_add_ons = 2;
55  }
56
57  // Additional config specs for a `similar-items` engine.
58  message SimilarDocumentsEngineConfig {}
59
60  // Additional config specs for a Media Recommendation engine.
61  message MediaRecommendationEngineConfig {
62    // Custom threshold for `cvr` optimization_objective.
63    message OptimizationObjectiveConfig {
64      // Required. The name of the field to target. Currently supported
65      // values: `watch-percentage`, `watch-time`.
66      string target_field = 1 [(google.api.field_behavior) = REQUIRED];
67
68      // Required. The threshold to be applied to the target (e.g., 0.5).
69      float target_field_value_float = 2
70          [(google.api.field_behavior) = REQUIRED];
71    }
72
73    // The training state of the engine.
74    enum TrainingState {
75      // Unspecified training state.
76      TRAINING_STATE_UNSPECIFIED = 0;
77
78      // The engine training is paused.
79      PAUSED = 1;
80
81      // The engine is training.
82      TRAINING = 2;
83    }
84
85    // Required. The type of engine. e.g., `recommended-for-you`.
86    //
87    // This field together with
88    // [optimization_objective][Engine.optimization_objective] describe engine
89    // metadata to use to control engine training and serving.
90    //
91    // Currently supported values: `recommended-for-you`, `others-you-may-like`,
92    // `more-like-this`, `most-popular-items`.
93    string type = 1 [(google.api.field_behavior) = REQUIRED];
94
95    // The optimization objective. e.g., `cvr`.
96    //
97    // This field together with
98    // [optimization_objective][google.cloud.discoveryengine.v1alpha.Engine.MediaRecommendationEngineConfig.type]
99    // describe engine metadata to use to control engine training and serving.
100    //
101    // Currently supported
102    // values: `ctr`, `cvr`.
103    //
104    //  If not specified, we choose default based on engine type.
105    // Default depends on type of recommendation:
106    //
107    // `recommended-for-you` => `ctr`
108    //
109    // `others-you-may-like` => `ctr`
110    string optimization_objective = 2;
111
112    // Name and value of the custom threshold for cvr optimization_objective.
113    // For target_field `watch-time`, target_field_value must be an integer
114    // value indicating the media progress time in seconds between (0, 86400]
115    // (excludes 0, includes 86400) (e.g., 90).
116    // For target_field `watch-percentage`, the target_field_value must be a
117    // valid float value between (0, 1.0] (excludes 0, includes 1.0) (e.g.,
118    // 0.5).
119    OptimizationObjectiveConfig optimization_objective_config = 3;
120
121    // The training state that the engine is in (e.g.
122    // `TRAINING` or `PAUSED`).
123    //
124    // Since part of the cost of running the service
125    // is frequency of training - this can be used to determine when to train
126    // engine in order to control cost. If not specified: the default value for
127    // `CreateEngine` method is `TRAINING`. The default value for
128    // `UpdateEngine` method is to keep the state the same as before.
129    TrainingState training_state = 4;
130  }
131
132  // Configurations for a Chat Engine.
133  message ChatEngineConfig {
134    // Configurations for generating a Dialogflow agent.
135    //
136    // Note that these configurations are one-time consumed by
137    // and passed to Dialogflow service. It means they cannot be retrieved using
138    // [EngineService.GetEngine][google.cloud.discoveryengine.v1alpha.EngineService.GetEngine]
139    // or
140    // [EngineService.ListEngines][google.cloud.discoveryengine.v1alpha.EngineService.ListEngines]
141    // API after engine creation.
142    message AgentCreationConfig {
143      // Name of the company, organization or other entity that the agent
144      // represents. Used for knowledge connector LLM prompt and for knowledge
145      // search.
146      string business = 1;
147
148      // Required. The default language of the agent as a language tag.
149      // See [Language
150      // Support](https://cloud.google.com/dialogflow/docs/reference/language)
151      // for a list of the currently supported language codes.
152      string default_language_code = 2;
153
154      // Required. The time zone of the agent from the [time zone
155      // database](https://www.iana.org/time-zones), e.g., America/New_York,
156      // Europe/Paris.
157      string time_zone = 3 [(google.api.field_behavior) = REQUIRED];
158
159      // Agent location for Agent creation, supported values: global/us/eu.
160      // If not provided, us Engine will create Agent using us-central-1 by
161      // default; eu Engine will create Agent using eu-west-1 by default.
162      string location = 4;
163    }
164
165    // The configurationt generate the Dialogflow agent that is associated to
166    // this Engine.
167    //
168    // Note that these configurations are one-time consumed by
169    // and passed to Dialogflow service. It means they cannot be retrieved using
170    // [EngineService.GetEngine][google.cloud.discoveryengine.v1alpha.EngineService.GetEngine]
171    // or
172    // [EngineService.ListEngines][google.cloud.discoveryengine.v1alpha.EngineService.ListEngines]
173    // API after engine creation.
174    AgentCreationConfig agent_creation_config = 1;
175
176    // The resource name of an exist Dialogflow agent to link to this Chat
177    // Engine. Customers can either provide `agent_creation_config` to create
178    // agent or provide an agent name that links the agent with the Chat engine.
179    //
180    // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
181    // ID>`.
182    //
183    // Note that the `dialogflow_agent_to_link` are one-time consumed by and
184    // passed to Dialogflow service. It means they cannot be retrieved using
185    // [EngineService.GetEngine][google.cloud.discoveryengine.v1alpha.EngineService.GetEngine]
186    // or
187    // [EngineService.ListEngines][google.cloud.discoveryengine.v1alpha.EngineService.ListEngines]
188    // API after engine creation. Use
189    // [ChatEngineMetadata.dialogflow_agent][google.cloud.discoveryengine.v1alpha.Engine.ChatEngineMetadata.dialogflow_agent]
190    // for actual agent association after Engine is created.
191    string dialogflow_agent_to_link = 2;
192  }
193
194  // Common configurations for an Engine.
195  message CommonConfig {
196    // Immutable. The name of the company, business or entity that is associated
197    // with the engine. Setting this may help improve LLM related features.
198    string company_name = 1 [(google.api.field_behavior) = IMMUTABLE];
199  }
200
201  // Additional information of a recommendation engine.
202  message RecommendationMetadata {
203    // The serving state of the recommendation engine.
204    enum ServingState {
205      // Unspecified serving state.
206      SERVING_STATE_UNSPECIFIED = 0;
207
208      // The engine is not serving.
209      INACTIVE = 1;
210
211      // The engine is serving and can be queried.
212      ACTIVE = 2;
213
214      // The engine is trained on tuned hyperparameters and can be
215      // queried.
216      TUNED = 3;
217    }
218
219    // Describes whether this engine have sufficient training data
220    // to be continuously trained.
221    enum DataState {
222      // Unspecified default value, should never be explicitly set.
223      DATA_STATE_UNSPECIFIED = 0;
224
225      // The engine has sufficient training data.
226      DATA_OK = 1;
227
228      // The engine does not have sufficient training data. Error
229      // messages can be queried via Stackdriver.
230      DATA_ERROR = 2;
231    }
232
233    // Output only. The serving state of the engine: `ACTIVE`, `NOT_ACTIVE`.
234    ServingState serving_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
235
236    // Output only. The state of data requirements for this engine: `DATA_OK`
237    // and `DATA_ERROR`.
238    //
239    // Engine cannot be trained if the data is in
240    // `DATA_ERROR` state. Engine can have `DATA_ERROR` state even
241    // if serving state is `ACTIVE`: engines were trained successfully before,
242    // but cannot be refreshed because the underlying engine no longer has
243    // sufficient data for training.
244    DataState data_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
245
246    // Output only. The timestamp when the latest successful tune finished. Only
247    // applicable on Media Recommendation engines.
248    google.protobuf.Timestamp last_tune_time = 3
249        [(google.api.field_behavior) = OUTPUT_ONLY];
250
251    // Output only. The latest tune operation id associated with the engine.
252    // Only applicable on Media Recommendation engines.
253    //
254    // If present, this operation id can be used to determine if there is an
255    // ongoing tune for this engine. To check the operation status, send the
256    // GetOperation request with this operation id in the engine resource
257    // format. If no tuning has happened for this engine, the string is empty.
258    string tuning_operation = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
259  }
260
261  // Additional information of a Chat Engine.
262  // Fields in this message are output only.
263  message ChatEngineMetadata {
264    // The resource name of a Dialogflow agent, that this Chat Engine refers
265    // to.
266    //
267    // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
268    // ID>`.
269    string dialogflow_agent = 1;
270  }
271
272  // Additional config specs that defines the behavior of the engine.
273  oneof engine_config {
274    // Additional config specs for a `similar-items` engine.
275    SimilarDocumentsEngineConfig similar_documents_config = 9;
276
277    // Configurations for the Chat Engine. Only applicable if
278    // [solution_type][google.cloud.discoveryengine.v1alpha.Engine.solution_type]
279    // is
280    // [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT].
281    ChatEngineConfig chat_engine_config = 11;
282
283    // Configurations for the Search Engine. Only applicable if
284    // [solution_type][google.cloud.discoveryengine.v1alpha.Engine.solution_type]
285    // is
286    // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_SEARCH].
287    SearchEngineConfig search_engine_config = 13;
288
289    // Configurations for the Media Engine. Only applicable on the data
290    // stores with
291    // [solution_type][google.cloud.discoveryengine.v1alpha.Engine.solution_type]
292    // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION]
293    // and
294    // [IndustryVertical.MEDIA][google.cloud.discoveryengine.v1alpha.IndustryVertical.MEDIA]
295    // vertical.
296    MediaRecommendationEngineConfig media_recommendation_engine_config = 14;
297  }
298
299  // Engine metadata to monitor the status of the engine.
300  oneof engine_metadata {
301    // Output only. Additional information of a recommendation engine. Only
302    // applicable if
303    // [solution_type][google.cloud.discoveryengine.v1alpha.Engine.solution_type]
304    // is
305    // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
306    RecommendationMetadata recommendation_metadata = 10
307        [(google.api.field_behavior) = OUTPUT_ONLY];
308
309    // Output only. Additional information of the Chat Engine. Only applicable
310    // if
311    // [solution_type][google.cloud.discoveryengine.v1alpha.Engine.solution_type]
312    // is
313    // [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT].
314    ChatEngineMetadata chat_engine_metadata = 12
315        [(google.api.field_behavior) = OUTPUT_ONLY];
316  }
317
318  // Immutable. The fully qualified resource name of the engine.
319  //
320  // This field must be a UTF-8 encoded string with a length limit of 1024
321  // characters.
322  //
323  // Format:
324  // `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}`
325  // engine should be 1-63 characters, and valid characters are
326  // /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned.
327  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
328
329  // Required. The display name of the engine. Should be human readable. UTF-8
330  // encoded string with limit of 1024 characters.
331  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
332
333  // Output only. Timestamp the Recommendation Engine was created at.
334  google.protobuf.Timestamp create_time = 3
335      [(google.api.field_behavior) = OUTPUT_ONLY];
336
337  // Output only. Timestamp the Recommendation Engine was last updated.
338  google.protobuf.Timestamp update_time = 4
339      [(google.api.field_behavior) = OUTPUT_ONLY];
340
341  // The data stores associated with this engine.
342  //
343  // For
344  // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_SEARCH]
345  // and
346  // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION]
347  // type of engines, they can only associate with at most one data store.
348  //
349  // If
350  // [solution_type][google.cloud.discoveryengine.v1alpha.Engine.solution_type]
351  // is
352  // [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT],
353  // multiple [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]s in
354  // the same [Collection][google.cloud.discoveryengine.v1alpha.Collection] can
355  // be associated here.
356  //
357  // Note that when used in
358  // [CreateEngineRequest][google.cloud.discoveryengine.v1alpha.CreateEngineRequest],
359  // one DataStore id must be provided as the system will use it for necessary
360  // initializations.
361  repeated string data_store_ids = 5;
362
363  // Required. The solutions of the engine.
364  SolutionType solution_type = 6 [(google.api.field_behavior) = REQUIRED];
365
366  // The industry vertical that the engine registers.
367  // The restriction of the Engine industry vertical is based on
368  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]: If
369  // unspecified, default to `GENERIC`. Vertical on Engine has to match vertical
370  // of the DataStore liniked to the engine.
371  IndustryVertical industry_vertical = 16;
372
373  // Common config spec that specifies the metadata of the engine.
374  CommonConfig common_config = 15;
375}
376