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.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/cloud/discoveryengine/v1/search_service.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; 25option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; 26option java_multiple_files = true; 27option java_outer_classname = "ConversationProto"; 28option java_package = "com.google.cloud.discoveryengine.v1"; 29option objc_class_prefix = "DISCOVERYENGINE"; 30option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; 31option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; 32 33// External conversation proto definition. 34message Conversation { 35 option (google.api.resource) = { 36 type: "discoveryengine.googleapis.com/Conversation" 37 pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}" 38 pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}" 39 pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}" 40 }; 41 42 // Enumeration of the state of the conversation. 43 enum State { 44 // Unknown. 45 STATE_UNSPECIFIED = 0; 46 47 // Conversation is currently open. 48 IN_PROGRESS = 1; 49 50 // Conversation has been completed. 51 COMPLETED = 2; 52 } 53 54 // Immutable. Fully qualified name 55 // `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` 56 // or 57 // `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. 58 string name = 1 [(google.api.field_behavior) = IMMUTABLE]; 59 60 // The state of the Conversation. 61 State state = 2; 62 63 // A unique identifier for tracking users. 64 string user_pseudo_id = 3; 65 66 // Conversation messages. 67 repeated ConversationMessage messages = 4; 68 69 // Output only. The time the conversation started. 70 google.protobuf.Timestamp start_time = 5 71 [(google.api.field_behavior) = OUTPUT_ONLY]; 72 73 // Output only. The time the conversation finished. 74 google.protobuf.Timestamp end_time = 6 75 [(google.api.field_behavior) = OUTPUT_ONLY]; 76} 77 78// Defines a reply message to user. 79message Reply { 80 // Summary based on search results. 81 SearchResponse.Summary summary = 3; 82} 83 84// Defines context of the conversation 85message ConversationContext { 86 // The current list of documents the user is seeing. 87 // It contains the document resource references. 88 repeated string context_documents = 1; 89 90 // The current active document the user opened. 91 // It contains the document resource reference. 92 string active_document = 2; 93} 94 95// Defines text input. 96message TextInput { 97 // Text input. 98 string input = 1; 99 100 // Conversation context of the input. 101 ConversationContext context = 2; 102} 103 104// Defines a conversation message. 105message ConversationMessage { 106 oneof message { 107 // User text input. 108 TextInput user_input = 1; 109 110 // Search reply. 111 Reply reply = 2; 112 } 113 114 // Output only. Message creation timestamp. 115 google.protobuf.Timestamp create_time = 3 116 [(google.api.field_behavior) = OUTPUT_ONLY]; 117} 118