Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::Document (v1.1.1)

Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::Document.

A knowledge document to be used by a KnowledgeBase.

For more information, see the knowledge base guide.

Note: The projects.agent.knowledgeBases.documents resource is deprecated; only use projects.knowledgeBases.documents.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#content_uri

def content_uri() -> ::String
Returns
  • (::String) — 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.

#content_uri=

def content_uri=(value) -> ::String
Parameter
  • value (::String) — 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.

Returns
  • (::String) — 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.

#display_name

def display_name() -> ::String
Returns
  • (::String) — Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.

#display_name=

def display_name=(value) -> ::String
Parameter
  • value (::String) — Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.
Returns
  • (::String) — Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.

#enable_auto_reload

def enable_auto_reload() -> ::Boolean
Returns
  • (::Boolean) — 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.

#enable_auto_reload=

def enable_auto_reload=(value) -> ::Boolean
Parameter
  • value (::Boolean) — 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.

Returns
  • (::Boolean) — 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.

#knowledge_types

def knowledge_types() -> ::Array<::Google::Cloud::Dialogflow::V2::Document::KnowledgeType>
Returns

#knowledge_types=

def knowledge_types=(value) -> ::Array<::Google::Cloud::Dialogflow::V2::Document::KnowledgeType>
Parameter
Returns

#latest_reload_status

def latest_reload_status() -> ::Google::Cloud::Dialogflow::V2::Document::ReloadStatus
Returns

#metadata

def metadata() -> ::Google::Protobuf::Map{::String => ::String}
Returns
  • (::Google::Protobuf::Map{::String => ::String}) — 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.

#metadata=

def metadata=(value) -> ::Google::Protobuf::Map{::String => ::String}
Parameter
  • value (::Google::Protobuf::Map{::String => ::String}) — 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.
Returns
  • (::Google::Protobuf::Map{::String => ::String}) — 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.

#mime_type

def mime_type() -> ::String
Returns
  • (::String) — Required. The MIME type of this document.

#mime_type=

def mime_type=(value) -> ::String
Parameter
  • value (::String) — Required. The MIME type of this document.
Returns
  • (::String) — Required. The MIME type of this document.

#name

def name() -> ::String
Returns
  • (::String) — 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>.

#name=

def name=(value) -> ::String
Parameter
  • value (::String) — 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>.
Returns
  • (::String) — 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>.

#raw_content

def raw_content() -> ::String
Returns
  • (::String) — The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.

#raw_content=

def raw_content=(value) -> ::String
Parameter
  • value (::String) — The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.
Returns
  • (::String) — The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.

#state

def state() -> ::Google::Cloud::Dialogflow::V2::Document::State
Returns