blob: 26f435ec5e21e9324341e9a72ed73069b1cb3b3a [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="dialogflow_v2beta1.html">Dialogflow API</a> . <a href="dialogflow_v2beta1.projects.html">projects</a> . <a href="dialogflow_v2beta1.projects.knowledgeBases.html">knowledgeBases</a> . <a href="dialogflow_v2beta1.projects.knowledgeBases.documents.html">documents</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080081 <code><a href="#create">create(parent, body=None, importGcsCustomMetadata=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070082<p class="firstline">Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070083<p class="toc_element">
84 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085<p class="firstline">Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070086<p class="toc_element">
87 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088<p class="firstline">Retrieves the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089<p class="toc_element">
yoshi-code-bota8b35b92021-03-31 13:33:30 -070090 <code><a href="#import_">import_(parent, body=None, x__xgafv=None)</a></code></p>
yoshi-code-botc2cd3262021-05-16 02:16:04 -070091<p class="firstline">Create documents by importing data from external sources. Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error.</p>
yoshi-code-bota8b35b92021-03-31 13:33:30 -070092<p class="toc_element">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -080093 <code><a href="#list">list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070094<p class="firstline">Returns the list of all documents of the knowledge base. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070095<p class="toc_element">
96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070099 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700100<p class="firstline">Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101<p class="toc_element">
102 <code><a href="#reload">reload(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700103<p class="firstline">Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes. Note: If the document source is Google Cloud Storage URI, its metadata will be replaced with the custom metadata from Google Cloud Storage if the `import_gcs_custom_metadata` field is set to true in the request. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700104<h3>Method Details</h3>
105<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700106 <code class="details" id="close">close()</code>
107 <pre>Close httplib2 connections.</pre>
108</div>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700110<div class="method">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800111 <code class="details" id="create">create(parent, body=None, importGcsCustomMetadata=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700112 <pre>Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700113
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700114Args:
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800115 parent: string, Required. The knowledge base to create a document for. Format: `projects//locations//knowledgeBases/`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700116 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117 The object takes the form of:
118
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700119{ # A knowledge document to be used by a KnowledgeBase. For more information, see the [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800120 &quot;content&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. Note: This field is in the process of being deprecated, please use raw_content instead.
121 &quot;contentUri&quot;: &quot;A String&quot;, # The URI where the file content is located. For documents stored in Google Cloud Storage, these URIs must have the form `gs:///`. NOTE: External URLs must correspond to public webpages, i.e., they must be indexed by Google Search. In particular, URLs for showing documents in Google Cloud Storage (i.e. the URL in your browser) are not supported. Instead use the `gs://` format URI described above.
122 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
123 &quot;enableAutoReload&quot;: True or False, # Optional. If true, we try to automatically reload the document every day (at a time picked by the system). If false or unspecified, we don&#x27;t try to automatically reload the document. Currently you can only enable automatic reload for documents sourced from a public url, see `source` field for the source types. Reload status can be tracked in `latest_reload_status`. If a reload fails, we will keep the document unchanged. If a reload fails with internal errors, the system will try to reload the document on the next day. If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the system will not try to reload the document anymore. You need to manually reload the document successfully by calling `ReloadDocument` and clear the errors.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800124 &quot;knowledgeTypes&quot;: [ # Required. The knowledge type of document content.
125 &quot;A String&quot;,
126 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800127 &quot;latestReloadStatus&quot;: { # The status of a reload attempt. # Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
128 &quot;status&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Output only. The status of a reload attempt or the initial load.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800129 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800130 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
131 {
132 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
133 },
134 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800135 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
Dan O'Mearadd494642020-05-01 07:42:23 -0700136 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800137 &quot;time&quot;: &quot;A String&quot;, # Output only. The time of a reload attempt. This reload may have been triggered automatically or manually and may not have succeeded.
138 },
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700139 &quot;metadata&quot;: { # Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document&#x27;s title, an external URL distinct from the document&#x27;s content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
140 &quot;a_key&quot;: &quot;A String&quot;,
141 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800142 &quot;mimeType&quot;: &quot;A String&quot;, # Required. The MIME type of this document.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800143 &quot;name&quot;: &quot;A String&quot;, # Optional. The document resource name. The name must be empty when creating a document. Format: `projects//locations//knowledgeBases//documents/`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800144 &quot;rawContent&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800145}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700146
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800147 importGcsCustomMetadata: boolean, Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 x__xgafv: string, V1 error format.
149 Allowed values
150 1 - v1 error format
151 2 - v2 error format
152
153Returns:
154 An object of the form:
155
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700156 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800157 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
158 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
159 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
160 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
161 {
162 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
163 },
164 ],
165 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
166 },
167 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
168 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
169 },
170 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
171 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
172 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
173 },
174}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175</div>
176
177<div class="method">
178 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700179 <pre>Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700180
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700181Args:
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800182 name: string, Required. The name of the document to delete. Format: `projects//locations//knowledgeBases//documents/`. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700183 x__xgafv: string, V1 error format.
184 Allowed values
185 1 - v1 error format
186 2 - v2 error format
187
188Returns:
189 An object of the form:
190
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700191 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800192 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
193 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
194 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
195 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
196 {
197 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
198 },
199 ],
200 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
201 },
202 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
203 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
204 },
205 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
206 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
207 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
208 },
209}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700210</div>
211
212<div class="method">
213 <code class="details" id="get">get(name, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700214 <pre>Retrieves the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700215
216Args:
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800217 name: string, Required. The name of the document to retrieve. Format `projects//locations//knowledgeBases//documents/`. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700218 x__xgafv: string, V1 error format.
219 Allowed values
220 1 - v1 error format
221 2 - v2 error format
222
223Returns:
224 An object of the form:
225
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700226 { # A knowledge document to be used by a KnowledgeBase. For more information, see the [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800227 &quot;content&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. Note: This field is in the process of being deprecated, please use raw_content instead.
228 &quot;contentUri&quot;: &quot;A String&quot;, # The URI where the file content is located. For documents stored in Google Cloud Storage, these URIs must have the form `gs:///`. NOTE: External URLs must correspond to public webpages, i.e., they must be indexed by Google Search. In particular, URLs for showing documents in Google Cloud Storage (i.e. the URL in your browser) are not supported. Instead use the `gs://` format URI described above.
229 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
230 &quot;enableAutoReload&quot;: True or False, # Optional. If true, we try to automatically reload the document every day (at a time picked by the system). If false or unspecified, we don&#x27;t try to automatically reload the document. Currently you can only enable automatic reload for documents sourced from a public url, see `source` field for the source types. Reload status can be tracked in `latest_reload_status`. If a reload fails, we will keep the document unchanged. If a reload fails with internal errors, the system will try to reload the document on the next day. If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the system will not try to reload the document anymore. You need to manually reload the document successfully by calling `ReloadDocument` and clear the errors.
231 &quot;knowledgeTypes&quot;: [ # Required. The knowledge type of document content.
232 &quot;A String&quot;,
233 ],
234 &quot;latestReloadStatus&quot;: { # The status of a reload attempt. # Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
235 &quot;status&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Output only. The status of a reload attempt or the initial load.
236 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
237 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
238 {
239 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
240 },
241 ],
242 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800243 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800244 &quot;time&quot;: &quot;A String&quot;, # Output only. The time of a reload attempt. This reload may have been triggered automatically or manually and may not have succeeded.
245 },
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700246 &quot;metadata&quot;: { # Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document&#x27;s title, an external URL distinct from the document&#x27;s content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
247 &quot;a_key&quot;: &quot;A String&quot;,
248 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800249 &quot;mimeType&quot;: &quot;A String&quot;, # Required. The MIME type of this document.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800250 &quot;name&quot;: &quot;A String&quot;, # Optional. The document resource name. The name must be empty when creating a document. Format: `projects//locations//knowledgeBases//documents/`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800251 &quot;rawContent&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
252}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700253</div>
254
255<div class="method">
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700256 <code class="details" id="import_">import_(parent, body=None, x__xgafv=None)</code>
yoshi-code-botc2cd3262021-05-16 02:16:04 -0700257 <pre>Create documents by importing data from external sources. Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700258
259Args:
260 parent: string, Required. The knowledge base to import documents into. Format: `projects//locations//knowledgeBases/`. (required)
261 body: object, The request body.
262 The object takes the form of:
263
264{ # Request message for Documents.ImportDocuments.
265 &quot;documentTemplate&quot;: { # The template used for importing documents. # Required. Document template used for importing all the documents.
266 &quot;knowledgeTypes&quot;: [ # Required. The knowledge type of document content.
267 &quot;A String&quot;,
268 ],
269 &quot;metadata&quot;: { # Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document&#x27;s title, an external URL distinct from the document&#x27;s content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
270 &quot;a_key&quot;: &quot;A String&quot;,
271 },
272 &quot;mimeType&quot;: &quot;A String&quot;, # Required. The MIME type of the document.
273 },
274 &quot;gcsSource&quot;: { # Google Cloud Storage locations for the inputs. # The Google Cloud Storage location for the documents. The path can include a wildcard. These URIs may have the forms `gs:///`. `gs:////*.`.
275 &quot;uris&quot;: [ # Required. Google Cloud Storage URIs for the inputs. A URI is of the form: gs://bucket/object-prefix-or-name Whether a prefix or name is used depends on the use case.
276 &quot;A String&quot;,
277 ],
278 },
279 &quot;importGcsCustomMetadata&quot;: True or False, # Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.
280}
281
282 x__xgafv: string, V1 error format.
283 Allowed values
284 1 - v1 error format
285 2 - v2 error format
286
287Returns:
288 An object of the form:
289
290 { # This resource represents a long-running operation that is the result of a network API call.
291 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
292 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
293 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
294 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
295 {
296 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
297 },
298 ],
299 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
300 },
301 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
302 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
303 },
304 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
305 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
306 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
307 },
308}</pre>
309</div>
310
311<div class="method">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800312 <code class="details" id="list">list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700313 <pre>Returns the list of all documents of the knowledge base. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700314
315Args:
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800316 parent: string, Required. The knowledge base to list all documents for. Format: `projects//locations//knowledgeBases/`. (required)
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800317 filter: string, The filter expression used to filter documents returned by the list method. The expression has the following syntax: [AND ] ... The following fields and operators are supported: * knowledge_types with has(:) operator * display_name with has(:) operator * state with equals(=) operator Examples: * &quot;knowledge_types:FAQ&quot; matches documents with FAQ knowledge type. * &quot;display_name:customer&quot; matches documents whose display name contains &quot;customer&quot;. * &quot;state=ACTIVE&quot; matches documents with ACTIVE state. * &quot;knowledge_types:FAQ AND state=ACTIVE&quot; matches all active FAQ documents. For more information about filtering, see [API Filtering](https://aip.dev/160).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700318 pageSize: integer, The maximum number of items to return in a single page. By default 10 and at most 100.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800319 pageToken: string, The next_page_token value returned from a previous list request.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700320 x__xgafv: string, V1 error format.
321 Allowed values
322 1 - v1 error format
323 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700324
325Returns:
326 An object of the form:
327
328 { # Response message for Documents.ListDocuments.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800329 &quot;documents&quot;: [ # The list of documents.
330 { # A knowledge document to be used by a KnowledgeBase. For more information, see the [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
331 &quot;content&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. Note: This field is in the process of being deprecated, please use raw_content instead.
332 &quot;contentUri&quot;: &quot;A String&quot;, # The URI where the file content is located. For documents stored in Google Cloud Storage, these URIs must have the form `gs:///`. NOTE: External URLs must correspond to public webpages, i.e., they must be indexed by Google Search. In particular, URLs for showing documents in Google Cloud Storage (i.e. the URL in your browser) are not supported. Instead use the `gs://` format URI described above.
333 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
334 &quot;enableAutoReload&quot;: True or False, # Optional. If true, we try to automatically reload the document every day (at a time picked by the system). If false or unspecified, we don&#x27;t try to automatically reload the document. Currently you can only enable automatic reload for documents sourced from a public url, see `source` field for the source types. Reload status can be tracked in `latest_reload_status`. If a reload fails, we will keep the document unchanged. If a reload fails with internal errors, the system will try to reload the document on the next day. If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the system will not try to reload the document anymore. You need to manually reload the document successfully by calling `ReloadDocument` and clear the errors.
335 &quot;knowledgeTypes&quot;: [ # Required. The knowledge type of document content.
336 &quot;A String&quot;,
337 ],
338 &quot;latestReloadStatus&quot;: { # The status of a reload attempt. # Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
339 &quot;status&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Output only. The status of a reload attempt or the initial load.
340 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
341 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
342 {
343 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
344 },
345 ],
346 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700347 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800348 &quot;time&quot;: &quot;A String&quot;, # Output only. The time of a reload attempt. This reload may have been triggered automatically or manually and may not have succeeded.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800349 },
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700350 &quot;metadata&quot;: { # Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document&#x27;s title, an external URL distinct from the document&#x27;s content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
351 &quot;a_key&quot;: &quot;A String&quot;,
352 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800353 &quot;mimeType&quot;: &quot;A String&quot;, # Required. The MIME type of this document.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800354 &quot;name&quot;: &quot;A String&quot;, # Optional. The document resource name. The name must be empty when creating a document. Format: `projects//locations//knowledgeBases//documents/`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800355 &quot;rawContent&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
356 },
357 ],
358 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results, or empty if there are no more results in the list.
359}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700360</div>
361
362<div class="method">
363 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
364 <pre>Retrieves the next page of results.
365
366Args:
367 previous_request: The request for the previous page. (required)
368 previous_response: The response from the request for the previous page. (required)
369
370Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700371 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700372 page. Returns None if there are no more items in the collection.
373 </pre>
374</div>
375
376<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700377 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700378 <pre>Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700379
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700380Args:
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800381 name: string, Optional. The document resource name. The name must be empty when creating a document. Format: `projects//locations//knowledgeBases//documents/`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700382 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700383 The object takes the form of:
384
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700385{ # A knowledge document to be used by a KnowledgeBase. For more information, see the [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800386 &quot;content&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. Note: This field is in the process of being deprecated, please use raw_content instead.
387 &quot;contentUri&quot;: &quot;A String&quot;, # The URI where the file content is located. For documents stored in Google Cloud Storage, these URIs must have the form `gs:///`. NOTE: External URLs must correspond to public webpages, i.e., they must be indexed by Google Search. In particular, URLs for showing documents in Google Cloud Storage (i.e. the URL in your browser) are not supported. Instead use the `gs://` format URI described above.
388 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
389 &quot;enableAutoReload&quot;: True or False, # Optional. If true, we try to automatically reload the document every day (at a time picked by the system). If false or unspecified, we don&#x27;t try to automatically reload the document. Currently you can only enable automatic reload for documents sourced from a public url, see `source` field for the source types. Reload status can be tracked in `latest_reload_status`. If a reload fails, we will keep the document unchanged. If a reload fails with internal errors, the system will try to reload the document on the next day. If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the system will not try to reload the document anymore. You need to manually reload the document successfully by calling `ReloadDocument` and clear the errors.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800390 &quot;knowledgeTypes&quot;: [ # Required. The knowledge type of document content.
391 &quot;A String&quot;,
392 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800393 &quot;latestReloadStatus&quot;: { # The status of a reload attempt. # Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
394 &quot;status&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Output only. The status of a reload attempt or the initial load.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800395 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800396 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
397 {
398 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
399 },
400 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800401 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
Dan O'Mearadd494642020-05-01 07:42:23 -0700402 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800403 &quot;time&quot;: &quot;A String&quot;, # Output only. The time of a reload attempt. This reload may have been triggered automatically or manually and may not have succeeded.
404 },
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700405 &quot;metadata&quot;: { # Optional. Metadata for the document. The metadata supports arbitrary key-value pairs. Suggested use cases include storing a document&#x27;s title, an external URL distinct from the document&#x27;s content_uri, etc. The max size of a `key` or a `value` of the metadata is 1024 bytes.
406 &quot;a_key&quot;: &quot;A String&quot;,
407 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800408 &quot;mimeType&quot;: &quot;A String&quot;, # Required. The MIME type of this document.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800409 &quot;name&quot;: &quot;A String&quot;, # Optional. The document resource name. The name must be empty when creating a document. Format: `projects//locations//knowledgeBases//documents/`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800410 &quot;rawContent&quot;: &quot;A String&quot;, # The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800411}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700412
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700413 updateMask: string, Optional. Not specified means `update all`. Currently, only `display_name` can be updated, an InvalidArgument will be returned for attempting to update other fields.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700414 x__xgafv: string, V1 error format.
415 Allowed values
416 1 - v1 error format
417 2 - v2 error format
418
419Returns:
420 An object of the form:
421
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700422 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800423 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
424 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
425 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
426 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
427 {
428 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
429 },
430 ],
431 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
432 },
433 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
434 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
435 },
436 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
437 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
438 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
439 },
440}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700441</div>
442
443<div class="method">
444 <code class="details" id="reload">reload(name, body=None, x__xgafv=None)</code>
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700445 <pre>Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes. Note: If the document source is Google Cloud Storage URI, its metadata will be replaced with the custom metadata from Google Cloud Storage if the `import_gcs_custom_metadata` field is set to true in the request. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700446
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700447Args:
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800448 name: string, Required. The name of the document to reload. Format: `projects//locations//knowledgeBases//documents/` (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700449 body: object, The request body.
450 The object takes the form of:
451
452{ # Request message for Documents.ReloadDocument.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800453 &quot;gcsSource&quot;: { # Google Cloud Storage location for single input. # The path for a Cloud Storage source file for reloading document content. If not provided, the Document&#x27;s existing source will be reloaded.
454 &quot;uri&quot;: &quot;A String&quot;, # Required. The Google Cloud Storage URIs for the inputs. A URI is of the form: gs://bucket/object-prefix-or-name Whether a prefix or name is used depends on the use case.
455 },
456 &quot;importGcsCustomMetadata&quot;: True or False, # Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.
457}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700458
459 x__xgafv: string, V1 error format.
460 Allowed values
461 1 - v1 error format
462 2 - v2 error format
463
464Returns:
465 An object of the form:
466
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700467 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800468 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
469 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
470 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
471 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
472 {
473 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
474 },
475 ],
476 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
477 },
478 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
479 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
480 },
481 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
482 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
483 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
484 },
485}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700486</div>
487
488</body></html>