public sealed class Document : IMessage<Document>, IEquatable<Document>, IDeepCloneable<Document>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Dialogflow v2 API class Document.
A knowledge document to be used by a [KnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBase].
For more information, see the knowledge base guide.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Namespace
Google.Cloud.Dialogflow.V2Assembly
Google.Cloud.Dialogflow.V2.dll
Constructors
Document()
public Document()
Document(Document)
public Document(Document other)
Parameter | |
---|---|
Name | Description |
other | Document |
Properties
ContentUri
public string ContentUri { get; set; }
The URI where the file content is located.
For documents stored in Google Cloud Storage, these URIs must have
the form gs://<bucket-name>/<object-name>
.
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.
Property Value | |
---|---|
Type | Description |
string |
DisplayName
public string DisplayName { get; set; }
Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
Property Value | |
---|---|
Type | Description |
string |
DocumentName
public DocumentName DocumentName { get; set; }
DocumentName-typed view over the Name resource name property.
Property Value | |
---|---|
Type | Description |
DocumentName |
EnableAutoReload
public bool EnableAutoReload { get; set; }
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'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. PERMISSION_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.
Property Value | |
---|---|
Type | Description |
bool |
HasContentUri
public bool HasContentUri { get; }
Gets whether the "content_uri" field is set
Property Value | |
---|---|
Type | Description |
bool |
HasRawContent
public bool HasRawContent { get; }
Gets whether the "raw_content" field is set
Property Value | |
---|---|
Type | Description |
bool |
KnowledgeTypes
public RepeatedField<Document.Types.KnowledgeType> KnowledgeTypes { get; }
Required. The knowledge type of document content.
Property Value | |
---|---|
Type | Description |
RepeatedFieldDocumentTypesKnowledgeType |
LatestReloadStatus
public Document.Types.ReloadStatus LatestReloadStatus { get; set; }
Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.
Property Value | |
---|---|
Type | Description |
DocumentTypesReloadStatus |
Metadata
public MapField<string, string> Metadata { get; }
Optional. Metadata for the document. The metadata supports arbitrary
key-value pairs. Suggested use cases include storing a document's title,
an external URL distinct from the document's content_uri, etc.
The max size of a key
or a value
of the metadata is 1024 bytes.
Property Value | |
---|---|
Type | Description |
MapFieldstringstring |
MimeType
public string MimeType { get; set; }
Required. The MIME type of this document.
Property Value | |
---|---|
Type | Description |
string |
Name
public string Name { get; set; }
Optional. The document resource name.
The name must be empty when creating a document.
Format: projects/<Project ID>/locations/<Location
ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>
.
Property Value | |
---|---|
Type | Description |
string |
RawContent
public ByteString RawContent { get; set; }
The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
Property Value | |
---|---|
Type | Description |
ByteString |
SourceCase
public Document.SourceOneofCase SourceCase { get; }
Property Value | |
---|---|
Type | Description |
DocumentSourceOneofCase |
State
public Document.Types.State State { get; set; }
Output only. The current state of the document.
Property Value | |
---|---|
Type | Description |
DocumentTypesState |