document.proto 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  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. syntax = "proto3";
  15. package google.cloud.dialogflow.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/dialogflow/v2/gcs.proto";
  21. import "google/longrunning/operations.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/protobuf/timestamp.proto";
  24. import "google/rpc/status.proto";
  25. option cc_enable_arenas = true;
  26. option csharp_namespace = "Google.Cloud.Dialogflow.V2";
  27. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
  28. option java_multiple_files = true;
  29. option java_outer_classname = "DocumentProto";
  30. option java_package = "com.google.cloud.dialogflow.v2";
  31. option objc_class_prefix = "DF";
  32. // Service for managing knowledge [Documents][google.cloud.dialogflow.v2.Document].
  33. service Documents {
  34. option (google.api.default_host) = "dialogflow.googleapis.com";
  35. option (google.api.oauth_scopes) =
  36. "https://www.googleapis.com/auth/cloud-platform,"
  37. "https://www.googleapis.com/auth/dialogflow";
  38. // Returns the list of all documents of the knowledge base.
  39. rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
  40. option (google.api.http) = {
  41. get: "/v2/{parent=projects/*/knowledgeBases/*}/documents"
  42. additional_bindings {
  43. get: "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents"
  44. }
  45. additional_bindings {
  46. get: "/v2/{parent=projects/*/agent/knowledgeBases/*}/documents"
  47. }
  48. };
  49. option (google.api.method_signature) = "parent";
  50. }
  51. // Retrieves the specified document.
  52. rpc GetDocument(GetDocumentRequest) returns (Document) {
  53. option (google.api.http) = {
  54. get: "/v2/{name=projects/*/knowledgeBases/*/documents/*}"
  55. additional_bindings {
  56. get: "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}"
  57. }
  58. additional_bindings {
  59. get: "/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}"
  60. }
  61. };
  62. option (google.api.method_signature) = "name";
  63. }
  64. // Creates a new document.
  65. //
  66. // This method is a [long-running
  67. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  68. // The returned `Operation` type has the following method-specific fields:
  69. //
  70. // - `metadata`: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
  71. // - `response`: [Document][google.cloud.dialogflow.v2.Document]
  72. rpc CreateDocument(CreateDocumentRequest) returns (google.longrunning.Operation) {
  73. option (google.api.http) = {
  74. post: "/v2/{parent=projects/*/knowledgeBases/*}/documents"
  75. body: "document"
  76. additional_bindings {
  77. post: "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents"
  78. body: "document"
  79. }
  80. additional_bindings {
  81. post: "/v2/{parent=projects/*/agent/knowledgeBases/*}/documents"
  82. body: "document"
  83. }
  84. };
  85. option (google.api.method_signature) = "parent,document";
  86. option (google.longrunning.operation_info) = {
  87. response_type: "Document"
  88. metadata_type: "KnowledgeOperationMetadata"
  89. };
  90. }
  91. // Creates documents by importing data from external sources.
  92. // Dialogflow supports up to 350 documents in each request. If you try to
  93. // import more, Dialogflow will return an error.
  94. //
  95. // This method is a [long-running
  96. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  97. // The returned `Operation` type has the following method-specific fields:
  98. //
  99. // - `metadata`: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
  100. // - `response`: [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse]
  101. rpc ImportDocuments(ImportDocumentsRequest) returns (google.longrunning.Operation) {
  102. option (google.api.http) = {
  103. post: "/v2/{parent=projects/*/knowledgeBases/*}/documents:import"
  104. body: "*"
  105. additional_bindings {
  106. post: "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import"
  107. body: "*"
  108. }
  109. };
  110. option (google.longrunning.operation_info) = {
  111. response_type: "ImportDocumentsResponse"
  112. metadata_type: "KnowledgeOperationMetadata"
  113. };
  114. }
  115. // Deletes the specified document.
  116. //
  117. // This method is a [long-running
  118. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  119. // The returned `Operation` type has the following method-specific fields:
  120. //
  121. // - `metadata`: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
  122. // - `response`: An [Empty
  123. // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
  124. rpc DeleteDocument(DeleteDocumentRequest) returns (google.longrunning.Operation) {
  125. option (google.api.http) = {
  126. delete: "/v2/{name=projects/*/knowledgeBases/*/documents/*}"
  127. additional_bindings {
  128. delete: "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}"
  129. }
  130. additional_bindings {
  131. delete: "/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}"
  132. }
  133. };
  134. option (google.api.method_signature) = "name";
  135. option (google.longrunning.operation_info) = {
  136. response_type: "google.protobuf.Empty"
  137. metadata_type: "KnowledgeOperationMetadata"
  138. };
  139. }
  140. // Updates the specified document.
  141. //
  142. // This method is a [long-running
  143. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  144. // The returned `Operation` type has the following method-specific fields:
  145. //
  146. // - `metadata`: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
  147. // - `response`: [Document][google.cloud.dialogflow.v2.Document]
  148. rpc UpdateDocument(UpdateDocumentRequest) returns (google.longrunning.Operation) {
  149. option (google.api.http) = {
  150. patch: "/v2/{document.name=projects/*/knowledgeBases/*/documents/*}"
  151. body: "document"
  152. additional_bindings {
  153. patch: "/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}"
  154. body: "document"
  155. }
  156. additional_bindings {
  157. patch: "/v2/{document.name=projects/*/agent/knowledgeBases/*/documents/*}"
  158. body: "document"
  159. }
  160. };
  161. option (google.api.method_signature) = "document,update_mask";
  162. option (google.longrunning.operation_info) = {
  163. response_type: "Document"
  164. metadata_type: "KnowledgeOperationMetadata"
  165. };
  166. }
  167. // Reloads the specified document from its specified source, content_uri or
  168. // content. The previously loaded content of the document will be deleted.
  169. // Note: Even when the content of the document has not changed, there still
  170. // may be side effects because of internal implementation changes.
  171. //
  172. // This method is a [long-running
  173. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  174. // The returned `Operation` type has the following method-specific fields:
  175. //
  176. // - `metadata`: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
  177. // - `response`: [Document][google.cloud.dialogflow.v2.Document]
  178. //
  179. // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
  180. // only use `projects.knowledgeBases.documents`.
  181. rpc ReloadDocument(ReloadDocumentRequest) returns (google.longrunning.Operation) {
  182. option (google.api.http) = {
  183. post: "/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload"
  184. body: "*"
  185. additional_bindings {
  186. post: "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload"
  187. body: "*"
  188. }
  189. additional_bindings {
  190. post: "/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload"
  191. body: "*"
  192. }
  193. };
  194. option (google.api.method_signature) = "name,content_uri";
  195. option (google.longrunning.operation_info) = {
  196. response_type: "Document"
  197. metadata_type: "KnowledgeOperationMetadata"
  198. };
  199. }
  200. // Exports a smart messaging candidate document into the specified
  201. // destination.
  202. //
  203. // This method is a [long-running
  204. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  205. // The returned `Operation` type has the following method-specific fields:
  206. //
  207. // - `metadata`: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
  208. // - `response`: [Document][google.cloud.dialogflow.v2.Document]
  209. rpc ExportDocument(ExportDocumentRequest) returns (google.longrunning.Operation) {
  210. option (google.api.http) = {
  211. post: "/v2/{name=projects/*/knowledgeBases/*/documents/*}:export"
  212. body: "*"
  213. additional_bindings {
  214. post: "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:export"
  215. body: "*"
  216. }
  217. };
  218. option (google.longrunning.operation_info) = {
  219. response_type: "Document"
  220. metadata_type: "KnowledgeOperationMetadata"
  221. };
  222. }
  223. }
  224. // A knowledge document to be used by a [KnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBase].
  225. //
  226. // For more information, see the [knowledge base
  227. // guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases).
  228. //
  229. // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
  230. // only use `projects.knowledgeBases.documents`.
  231. message Document {
  232. option (google.api.resource) = {
  233. type: "dialogflow.googleapis.com/Document"
  234. pattern: "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}"
  235. pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}"
  236. };
  237. // The knowledge type of document content.
  238. enum KnowledgeType {
  239. // The type is unspecified or arbitrary.
  240. KNOWLEDGE_TYPE_UNSPECIFIED = 0;
  241. // The document content contains question and answer pairs as either HTML or
  242. // CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats
  243. // may fail to be parsed.
  244. //
  245. // CSV must have questions in the first column and answers in the second,
  246. // with no header. Because of this explicit format, they are always parsed
  247. // accurately.
  248. FAQ = 1;
  249. // Documents for which unstructured text is extracted and used for
  250. // question answering.
  251. EXTRACTIVE_QA = 2;
  252. // The entire document content as a whole can be used for query results.
  253. // Only for Contact Center Solutions on Dialogflow.
  254. ARTICLE_SUGGESTION = 3;
  255. // The document contains agent-facing Smart Reply entries.
  256. AGENT_FACING_SMART_REPLY = 4;
  257. }
  258. // The status of a reload attempt.
  259. message ReloadStatus {
  260. // The time of a reload attempt.
  261. // This reload may have been triggered automatically or manually and may
  262. // not have succeeded.
  263. google.protobuf.Timestamp time = 1;
  264. // The status of a reload attempt or the initial load.
  265. google.rpc.Status status = 2;
  266. }
  267. // Possible states of the document
  268. enum State {
  269. // The document state is unspecified.
  270. STATE_UNSPECIFIED = 0;
  271. // The document creation is in progress.
  272. CREATING = 1;
  273. // The document is active and ready to use.
  274. ACTIVE = 2;
  275. // The document updation is in progress.
  276. UPDATING = 3;
  277. // The document is reloading.
  278. RELOADING = 4;
  279. // The document deletion is in progress.
  280. DELETING = 5;
  281. }
  282. // Optional. The document resource name.
  283. // The name must be empty when creating a document.
  284. // Format: `projects/<Project ID>/locations/<Location
  285. // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
  286. string name = 1 [(google.api.field_behavior) = OPTIONAL];
  287. // Required. The display name of the document. The name must be 1024 bytes or
  288. // less; otherwise, the creation request fails.
  289. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  290. // Required. The MIME type of this document.
  291. string mime_type = 3 [(google.api.field_behavior) = REQUIRED];
  292. // Required. The knowledge type of document content.
  293. repeated KnowledgeType knowledge_types = 4 [(google.api.field_behavior) = REQUIRED];
  294. // Required. The source of this document.
  295. oneof source {
  296. // The URI where the file content is located.
  297. //
  298. // For documents stored in Google Cloud Storage, these URIs must have
  299. // the form `gs://<bucket-name>/<object-name>`.
  300. //
  301. // NOTE: External URLs must correspond to public webpages, i.e., they must
  302. // be indexed by Google Search. In particular, URLs for showing documents in
  303. // Google Cloud Storage (i.e. the URL in your browser) are not supported.
  304. // Instead use the `gs://` format URI described above.
  305. string content_uri = 5;
  306. // The raw content of the document. This field is only permitted for
  307. // EXTRACTIVE_QA and FAQ knowledge types.
  308. bytes raw_content = 9;
  309. }
  310. // Optional. If true, we try to automatically reload the document every day
  311. // (at a time picked by the system). If false or unspecified, we don't try
  312. // to automatically reload the document.
  313. //
  314. // Currently you can only enable automatic reload for documents sourced from
  315. // a public url, see `source` field for the source types.
  316. //
  317. // Reload status can be tracked in `latest_reload_status`. If a reload
  318. // fails, we will keep the document unchanged.
  319. //
  320. // If a reload fails with internal errors, the system will try to reload the
  321. // document on the next day.
  322. // If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the
  323. // system will not try to reload the document anymore. You need to manually
  324. // reload the document successfully by calling `ReloadDocument` and clear the
  325. // errors.
  326. bool enable_auto_reload = 11 [(google.api.field_behavior) = OPTIONAL];
  327. // Output only. The time and status of the latest reload.
  328. // This reload may have been triggered automatically or manually
  329. // and may not have succeeded.
  330. ReloadStatus latest_reload_status = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  331. // Optional. Metadata for the document. The metadata supports arbitrary
  332. // key-value pairs. Suggested use cases include storing a document's title,
  333. // an external URL distinct from the document's content_uri, etc.
  334. // The max size of a `key` or a `value` of the metadata is 1024 bytes.
  335. map<string, string> metadata = 7 [(google.api.field_behavior) = OPTIONAL];
  336. // Output only. The current state of the document.
  337. State state = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  338. }
  339. // Request message for [Documents.GetDocument][google.cloud.dialogflow.v2.Documents.GetDocument].
  340. message GetDocumentRequest {
  341. // Required. The name of the document to retrieve.
  342. // Format `projects/<Project ID>/locations/<Location
  343. // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
  344. string name = 1 [
  345. (google.api.field_behavior) = REQUIRED,
  346. (google.api.resource_reference) = {
  347. type: "dialogflow.googleapis.com/Document"
  348. }
  349. ];
  350. }
  351. // Request message for [Documents.ListDocuments][google.cloud.dialogflow.v2.Documents.ListDocuments].
  352. message ListDocumentsRequest {
  353. // Required. The knowledge base to list all documents for.
  354. // Format: `projects/<Project ID>/locations/<Location
  355. // ID>/knowledgeBases/<Knowledge Base ID>`.
  356. string parent = 1 [
  357. (google.api.field_behavior) = REQUIRED,
  358. (google.api.resource_reference) = {
  359. child_type: "dialogflow.googleapis.com/Document"
  360. }
  361. ];
  362. // The maximum number of items to return in a single page. By
  363. // default 10 and at most 100.
  364. int32 page_size = 2;
  365. // The next_page_token value returned from a previous list request.
  366. string page_token = 3;
  367. // The filter expression used to filter documents returned by the list method.
  368. // The expression has the following syntax:
  369. //
  370. // <field> <operator> <value> [AND <field> <operator> <value>] ...
  371. //
  372. // The following fields and operators are supported:
  373. //
  374. // * knowledge_types with has(:) operator
  375. // * display_name with has(:) operator
  376. // * state with equals(=) operator
  377. //
  378. // Examples:
  379. //
  380. // * "knowledge_types:FAQ" matches documents with FAQ knowledge type.
  381. // * "display_name:customer" matches documents whose display name contains
  382. // "customer".
  383. // * "state=ACTIVE" matches documents with ACTIVE state.
  384. // * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents.
  385. //
  386. // For more information about filtering, see
  387. // [API Filtering](https://aip.dev/160).
  388. string filter = 4;
  389. }
  390. // Response message for [Documents.ListDocuments][google.cloud.dialogflow.v2.Documents.ListDocuments].
  391. message ListDocumentsResponse {
  392. // The list of documents.
  393. repeated Document documents = 1;
  394. // Token to retrieve the next page of results, or empty if there are no
  395. // more results in the list.
  396. string next_page_token = 2;
  397. }
  398. // Request message for [Documents.CreateDocument][google.cloud.dialogflow.v2.Documents.CreateDocument].
  399. message CreateDocumentRequest {
  400. // Required. The knowledge base to create a document for.
  401. // Format: `projects/<Project ID>/locations/<Location
  402. // ID>/knowledgeBases/<Knowledge Base ID>`.
  403. string parent = 1 [
  404. (google.api.field_behavior) = REQUIRED,
  405. (google.api.resource_reference) = {
  406. child_type: "dialogflow.googleapis.com/Document"
  407. }
  408. ];
  409. // Required. The document to create.
  410. Document document = 2 [(google.api.field_behavior) = REQUIRED];
  411. }
  412. // Request message for [Documents.ImportDocuments][google.cloud.dialogflow.v2.Documents.ImportDocuments].
  413. message ImportDocumentsRequest {
  414. // Required. The knowledge base to import documents into.
  415. // Format: `projects/<Project ID>/locations/<Location
  416. // ID>/knowledgeBases/<Knowledge Base ID>`.
  417. string parent = 1 [
  418. (google.api.field_behavior) = REQUIRED,
  419. (google.api.resource_reference) = {
  420. child_type: "dialogflow.googleapis.com/Document"
  421. }
  422. ];
  423. // Required. The source to use for importing documents.
  424. //
  425. // If the source captures multiple objects, then multiple documents will be
  426. // created, one corresponding to each object, and all of these documents will
  427. // be created using the same document template.
  428. //
  429. // Dialogflow supports up to 350 documents in each request. If you try to
  430. // import more, Dialogflow will return an error.
  431. oneof source {
  432. // The Google Cloud Storage location for the documents.
  433. // The path can include a wildcard.
  434. //
  435. // These URIs may have the forms
  436. // `gs://<bucket-name>/<object-name>`.
  437. // `gs://<bucket-name>/<object-path>/*.<extension>`.
  438. GcsSources gcs_source = 2;
  439. }
  440. // Required. Document template used for importing all the documents.
  441. ImportDocumentTemplate document_template = 3 [(google.api.field_behavior) = REQUIRED];
  442. // Whether to import custom metadata from Google Cloud Storage.
  443. // Only valid when the document source is Google Cloud Storage URI.
  444. bool import_gcs_custom_metadata = 4;
  445. }
  446. // The template used for importing documents.
  447. message ImportDocumentTemplate {
  448. // Required. The MIME type of the document.
  449. string mime_type = 1 [(google.api.field_behavior) = REQUIRED];
  450. // Required. The knowledge type of document content.
  451. repeated Document.KnowledgeType knowledge_types = 2 [(google.api.field_behavior) = REQUIRED];
  452. // Metadata for the document. The metadata supports arbitrary
  453. // key-value pairs. Suggested use cases include storing a document's title,
  454. // an external URL distinct from the document's content_uri, etc.
  455. // The max size of a `key` or a `value` of the metadata is 1024 bytes.
  456. map<string, string> metadata = 3;
  457. }
  458. // Response message for [Documents.ImportDocuments][google.cloud.dialogflow.v2.Documents.ImportDocuments].
  459. message ImportDocumentsResponse {
  460. // Includes details about skipped documents or any other warnings.
  461. repeated google.rpc.Status warnings = 1;
  462. }
  463. // Request message for [Documents.DeleteDocument][google.cloud.dialogflow.v2.Documents.DeleteDocument].
  464. message DeleteDocumentRequest {
  465. // Required. The name of the document to delete.
  466. // Format: `projects/<Project ID>/locations/<Location
  467. // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
  468. string name = 1 [
  469. (google.api.field_behavior) = REQUIRED,
  470. (google.api.resource_reference) = {
  471. type: "dialogflow.googleapis.com/Document"
  472. }
  473. ];
  474. }
  475. // Request message for [Documents.UpdateDocument][google.cloud.dialogflow.v2.Documents.UpdateDocument].
  476. message UpdateDocumentRequest {
  477. // Required. The document to update.
  478. Document document = 1 [(google.api.field_behavior) = REQUIRED];
  479. // Optional. Not specified means `update all`.
  480. // Currently, only `display_name` can be updated, an InvalidArgument will be
  481. // returned for attempting to update other fields.
  482. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
  483. }
  484. // Request message for [Documents.ReloadDocument][google.cloud.dialogflow.v2.Documents.ReloadDocument].
  485. message ReloadDocumentRequest {
  486. // Required. The name of the document to reload.
  487. // Format: `projects/<Project ID>/locations/<Location
  488. // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`
  489. string name = 1 [
  490. (google.api.field_behavior) = REQUIRED,
  491. (google.api.resource_reference) = {
  492. type: "dialogflow.googleapis.com/Document"
  493. }
  494. ];
  495. // The source for document reloading.
  496. // If provided, the service will load the contents from the source
  497. // and update document in the knowledge base.
  498. oneof source {
  499. // Optional. The path of gcs source file for reloading document content. For now,
  500. // only gcs uri is supported.
  501. //
  502. // For documents stored in Google Cloud Storage, these URIs must have
  503. // the form `gs://<bucket-name>/<object-name>`.
  504. string content_uri = 3 [(google.api.field_behavior) = OPTIONAL];
  505. }
  506. // Optional. Whether to import custom metadata from Google Cloud Storage.
  507. // Only valid when the document source is Google Cloud Storage URI.
  508. bool import_gcs_custom_metadata = 4 [(google.api.field_behavior) = OPTIONAL];
  509. // Optional. When enabled, the reload request is to apply partial update to the smart
  510. // messaging allowlist.
  511. bool smart_messaging_partial_update = 5 [(google.api.field_behavior) = OPTIONAL];
  512. }
  513. // Request message for [Documents.ExportDocument][google.cloud.dialogflow.v2.Documents.ExportDocument].
  514. message ExportDocumentRequest {
  515. // Required. The name of the document to export.
  516. // Format: `projects/<Project ID>/locations/<Location
  517. // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
  518. string name = 1 [
  519. (google.api.field_behavior) = REQUIRED,
  520. (google.api.resource_reference) = {
  521. type: "dialogflow.googleapis.com/Document"
  522. }
  523. ];
  524. // Required. The destination for the export.
  525. oneof destination {
  526. // Cloud Storage file path to export the document.
  527. GcsDestination gcs_destination = 2;
  528. }
  529. // When enabled, export the full content of the document including empirical
  530. // probability.
  531. bool export_full_content = 3;
  532. // When enabled, export the smart messaging allowlist document for partial
  533. // update.
  534. bool smart_messaging_partial_update = 5;
  535. }
  536. // Metadata related to the Export Data Operations (e.g. ExportDocument).
  537. message ExportOperationMetadata {
  538. // Cloud Storage file path of the exported data.
  539. GcsDestination exported_gcs_destination = 1;
  540. }
  541. // Metadata in google::longrunning::Operation for Knowledge operations.
  542. message KnowledgeOperationMetadata {
  543. // States of the operation.
  544. enum State {
  545. // State unspecified.
  546. STATE_UNSPECIFIED = 0;
  547. // The operation has been created.
  548. PENDING = 1;
  549. // The operation is currently running.
  550. RUNNING = 2;
  551. // The operation is done, either cancelled or completed.
  552. DONE = 3;
  553. }
  554. // Output only. The current state of this operation.
  555. State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  556. // The name of the knowledge base interacted with during the operation.
  557. string knowledge_base = 3;
  558. // Additional metadata for the Knowledge operation.
  559. oneof operation_metadata {
  560. // Metadata for the Export Data Operation such as the destination of export.
  561. ExportOperationMetadata export_operation_metadata = 4;
  562. }
  563. }