xref: /aosp_15_r20/external/googleapis/google/cloud/discoveryengine/v1beta/session.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.v1beta;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22
23option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
24option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
25option java_multiple_files = true;
26option java_outer_classname = "SessionProto";
27option java_package = "com.google.cloud.discoveryengine.v1beta";
28option objc_class_prefix = "DISCOVERYENGINE";
29option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
30option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
31
32// External session proto definition.
33message Session {
34  option (google.api.resource) = {
35    type: "discoveryengine.googleapis.com/Session"
36    pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}"
37    pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}"
38    pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}"
39  };
40
41  // Represents a turn, including a query from the user and a
42  // answer from service.
43  message Turn {
44    // The user query.
45    Query query = 1;
46
47    // The resource name of the answer to the user query.
48    string answer = 2 [(google.api.resource_reference) = {
49      type: "discoveryengine.googleapis.com/Answer"
50    }];
51  }
52
53  // Enumeration of the state of the session.
54  enum State {
55    // State is unspecified.
56    STATE_UNSPECIFIED = 0;
57
58    // The session is currently open.
59    IN_PROGRESS = 1;
60  }
61
62  // Immutable. Fully qualified name
63  // `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*`
64  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
65
66  // The state of the session.
67  State state = 2;
68
69  // A unique identifier for tracking users.
70  string user_pseudo_id = 3;
71
72  // Turns.
73  repeated Turn turns = 4;
74
75  // Output only. The time the session started.
76  google.protobuf.Timestamp start_time = 5
77      [(google.api.field_behavior) = OUTPUT_ONLY];
78
79  // Output only. The time the session finished.
80  google.protobuf.Timestamp end_time = 6
81      [(google.api.field_behavior) = OUTPUT_ONLY];
82}
83
84// Defines a user inputed query.
85message Query {
86  // Query content.
87  oneof content {
88    // Plain text.
89    string text = 2;
90  }
91
92  // Unique Id for the query.
93  string query_id = 1;
94}
95