1 // Copyright 2018 Google LLC
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 package google.cloud.dialogflow.v2beta1;
19 import "google/api/annotations.proto";
20 import "google/protobuf/empty.proto";
21 import "google/protobuf/field_mask.proto";
23 option cc_enable_arenas = true;
24 option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
25 option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
26 option java_multiple_files = true;
27 option java_outer_classname = "KnowledgeBaseProto";
28 option java_package = "com.google.cloud.dialogflow.v2beta1";
29 option objc_class_prefix = "DF";
31 // Manages knowledge bases.
33 // Allows users to setup and maintain knowledge bases with their knowledge data.
34 service KnowledgeBases {
35 // Returns the list of all knowledge bases of the specified agent.
36 rpc ListKnowledgeBases(ListKnowledgeBasesRequest)
37 returns (ListKnowledgeBasesResponse) {
38 option (google.api.http) = {
39 get: "/v2beta1/{parent=projects/*}/knowledgeBases"
41 get: "/v2beta1/{parent=projects/*/agent}/knowledgeBases"
46 // Retrieves the specified knowledge base.
47 rpc GetKnowledgeBase(GetKnowledgeBaseRequest) returns (KnowledgeBase) {
48 option (google.api.http) = {
49 get: "/v2beta1/{name=projects/*/knowledgeBases/*}"
51 get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}"
56 // Creates a knowledge base.
57 rpc CreateKnowledgeBase(CreateKnowledgeBaseRequest) returns (KnowledgeBase) {
58 option (google.api.http) = {
59 post: "/v2beta1/{parent=projects/*}/knowledgeBases"
60 body: "knowledge_base"
62 post: "/v2beta1/{parent=projects/*/agent}/knowledgeBases"
63 body: "knowledge_base"
68 // Deletes the specified knowledge base.
69 rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest)
70 returns (google.protobuf.Empty) {
71 option (google.api.http) = {
72 delete: "/v2beta1/{name=projects/*/knowledgeBases/*}"
74 delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}"
80 // Represents knowledge base resource.
81 message KnowledgeBase {
82 // The knowledge base resource name.
83 // The name must be empty when creating a knowledge base.
84 // Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
87 // Required. The display name of the knowledge base. The name must be 1024
88 // bytes or less; otherwise, the creation request fails.
89 string display_name = 2;
92 // Request message for
93 // [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases].
94 message ListKnowledgeBasesRequest {
95 // Required. The agent to list of knowledge bases for.
96 // Format: `projects/<Project ID>/agent`.
99 // Optional. The maximum number of items to return in a single page. By
100 // default 10 and at most 100.
103 // Optional. The next_page_token value returned from a previous list request.
104 string page_token = 3;
107 // Response message for
108 // [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases].
109 message ListKnowledgeBasesResponse {
110 // The list of knowledge bases.
111 repeated KnowledgeBase knowledge_bases = 1;
113 // Token to retrieve the next page of results, or empty if there are no
114 // more results in the list.
115 string next_page_token = 2;
118 // Request message for [KnowledgeBase.GetDocument][].
119 message GetKnowledgeBaseRequest {
120 // Required. The name of the knowledge base to retrieve.
121 // Format `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
125 // Request message for
126 // [KnowledgeBases.CreateKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBase].
127 message CreateKnowledgeBaseRequest {
128 // Required. The agent to create a knowledge base for.
129 // Format: `projects/<Project ID>/agent`.
132 // Required. The knowledge base to create.
133 KnowledgeBase knowledge_base = 2;
136 // Request message for
137 // [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase].
138 message DeleteKnowledgeBaseRequest {
139 // Required. The name of the knowledge base to delete.
140 // Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
143 // Optional. Force deletes the knowledge base. When set to true, any documents
144 // in the knowledge base are also deleted.