Service Client: Google::Cloud::Dialogflow::V2::Document::DocumentsClient

Client stub representing the remote Documents gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to dialogflow.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Cloud::Dialogflow::V2::Document - Compiled Protocol Buffers messages for google/cloud/dialogflow/v2/document.proto

SYNOPSIS

use Google::Cloud::Dialogflow::V2::Document;

my $msg = Google::Cloud::Dialogflow::V2::Document::Document->new({
    name => $name,
    display_name => $display_name,
    mime_type => $mime_type,
    knowledge_types => $knowledge_types,
});

# Read or update a field
my $val = $msg->name();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Dialogflow::V2::Document::Document->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/dialogflow/v2/document.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Dialogflow::V2::Document::Document

A knowledge document to be used by a [KnowledgeBase][google.cloud.dialogflow.v2.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`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: 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>`.

  • $msg->display_name() / $msg->display_name($value)

    Type: String

    Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails.

  • $msg->mime_type() / $msg->mime_type($value)

    Type: String

    Required. The MIME type of this document.

  • $msg->knowledge_types() / $msg->knowledge_types($value)

    Type: Enum (Google::Cloud::Dialogflow::V2::Document::KnowledgeType)

    Required. The knowledge type of document content.

  • $msg->content_uri() / $msg->content_uri($value)

    Type: 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.

  • $msg->raw_content() / $msg->raw_content($value)

    Type: Bytes

    The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types.

  • $msg->enable_auto_reload() / $msg->enable_auto_reload($value)

    Type: Bool

    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.

  • $msg->latest_reload_status() / $msg->latest_reload_status($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Document::Document::ReloadStatus)

    Output only. The time and status of the latest reload. This reload may have been triggered automatically or manually and may not have succeeded.

  • $msg->metadata() / $msg->metadata($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Document::Document::MetadataEntry)

    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.

  • $msg->state() / $msg->state($value)

    Type: Enum (Google::Cloud::Dialogflow::V2::Document::State)

    Output only. The current state of the document.

Enum: Document::KnowledgeType

  • KNOWLEDGE_TYPE_UNSPECIFIED => 0

  • FAQ => 1

  • EXTRACTIVE_QA => 2

  • ARTICLE_SUGGESTION => 3

  • AGENT_FACING_SMART_REPLY => 4

Enum: Document::State

  • STATE_UNSPECIFIED => 0

  • CREATING => 1

  • ACTIVE => 2

  • UPDATING => 3

  • RELOADING => 4

  • DELETING => 5

Google::Cloud::Dialogflow::V2::Document::GetDocumentRequest

Request message for [Documents.GetDocument][google.cloud.dialogflow.v2.Documents.GetDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the document to retrieve. Format `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.

Google::Cloud::Dialogflow::V2::Document::ListDocumentsRequest

Request message for [Documents.ListDocuments][google.cloud.dialogflow.v2.Documents.ListDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The knowledge base to list all documents for. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>`.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of items to return in a single page. By default 10 and at most 100.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    The next_page_token value returned from a previous list request.

  • $msg->filter() / $msg->filter($value)

    Type: String

    The filter expression used to filter documents returned by the list method. The expression has the following syntax:

    <field> <operator> <value> [AND <field> <operator> <value>] ...

    The following fields and operators are supported:

    * knowledge_types with has(:) operator * display_name with has(:) operator * state with equals(=) operator

    Examples:

    * "knowledge_types:FAQ" matches documents with FAQ knowledge type. * "display_name:customer" matches documents whose display name contains "customer". * "state=ACTIVE" matches documents with ACTIVE state. * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents.

    For more information about filtering, see [API Filtering](https://aip.dev/160).

Google::Cloud::Dialogflow::V2::Document::ListDocumentsResponse

Response message for [Documents.ListDocuments][google.cloud.dialogflow.v2.Documents.ListDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->documents() / $msg->documents($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Document::Document)

    The list of documents.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    Token to retrieve the next page of results, or empty if there are no more results in the list.

Google::Cloud::Dialogflow::V2::Document::CreateDocumentRequest

Request message for [Documents.CreateDocument][google.cloud.dialogflow.v2.Documents.CreateDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The knowledge base to create a document for. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>`.

  • $msg->document() / $msg->document($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Document::Document)

    Required. The document to create.

Google::Cloud::Dialogflow::V2::Document::ImportDocumentsRequest

Request message for [Documents.ImportDocuments][google.cloud.dialogflow.v2.Documents.ImportDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The knowledge base to import documents into. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>`.

  • $msg->gcs_source() / $msg->gcs_source($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Gcs::GcsSources)

    Optional. The Google Cloud Storage location for the documents. The path can include a wildcard.

    These URIs may have the forms `gs://<bucket-name>/<object-name>`. `gs://<bucket-name>/<object-path>/*.<extension>`.

  • $msg->document_template() / $msg->document_template($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Document::ImportDocumentTemplate)

    Required. Document template used for importing all the documents.

  • $msg->import_gcs_custom_metadata() / $msg->import_gcs_custom_metadata($value)

    Type: Bool

    Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.

Google::Cloud::Dialogflow::V2::Document::ImportDocumentTemplate

The template used for importing documents.

Inherits from Protobuf::Message.

Accessors

  • $msg->mime_type() / $msg->mime_type($value)

    Type: String

    Required. The MIME type of the document.

  • $msg->knowledge_types() / $msg->knowledge_types($value)

    Type: Enum (Google::Cloud::Dialogflow::V2::Document::KnowledgeType)

    Required. The knowledge type of document content.

  • $msg->metadata() / $msg->metadata($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Document::ImportDocumentTemplate::MetadataEntry)

    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.

Google::Cloud::Dialogflow::V2::Document::ImportDocumentsResponse

Response message for [Documents.ImportDocuments][google.cloud.dialogflow.v2.Documents.ImportDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->warnings() / $msg->warnings($value)

    Type: Message (Google::Rpc::Status::Status)

    Includes details about skipped documents or any other warnings.

Google::Cloud::Dialogflow::V2::Document::DeleteDocumentRequest

Request message for [Documents.DeleteDocument][google.cloud.dialogflow.v2.Documents.DeleteDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the document to delete. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.

Google::Cloud::Dialogflow::V2::Document::UpdateDocumentRequest

Request message for [Documents.UpdateDocument][google.cloud.dialogflow.v2.Documents.UpdateDocument].

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Dialogflow::V2::Document::ReloadDocumentRequest

Request message for [Documents.ReloadDocument][google.cloud.dialogflow.v2.Documents.ReloadDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the document to reload. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`

  • $msg->content_uri() / $msg->content_uri($value)

    Type: String

    Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported.

    For documents stored in Google Cloud Storage, these URIs must have the form `gs://<bucket-name>/<object-name>`.

  • $msg->import_gcs_custom_metadata() / $msg->import_gcs_custom_metadata($value)

    Type: Bool

    Optional. Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.

  • $msg->smart_messaging_partial_update() / $msg->smart_messaging_partial_update($value)

    Type: Bool

    Optional. When enabled, the reload request is to apply partial update to the smart messaging allowlist.

Google::Cloud::Dialogflow::V2::Document::ExportDocumentRequest

Request message for [Documents.ExportDocument][google.cloud.dialogflow.v2.Documents.ExportDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the document to export. Format: `projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.

  • $msg->gcs_destination() / $msg->gcs_destination($value)

    Type: Message (Google::Cloud::Dialogflow::V2::Gcs::GcsDestination)

    Cloud Storage file path to export the document.

  • $msg->export_full_content() / $msg->export_full_content($value)

    Type: Bool

    When enabled, export the full content of the document including empirical probability.

  • $msg->smart_messaging_partial_update() / $msg->smart_messaging_partial_update($value)

    Type: Bool

    When enabled, export the smart messaging allowlist document for partial update.

Google::Cloud::Dialogflow::V2::Document::ExportOperationMetadata

Metadata related to the Export Data Operations (e.g. ExportDocument).

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Dialogflow::V2::Document::KnowledgeOperationMetadata

Metadata in google::longrunning::Operation for Knowledge operations.

Inherits from Protobuf::Message.

Accessors

Enum: KnowledgeOperationMetadata::State

  • STATE_UNSPECIFIED => 0

  • PENDING => 1

  • RUNNING => 2

  • DONE => 3

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Dialogflow::V2::Document::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.