REST Resource: projects.agent.knowledgeBases.documents

Resource: Document

A document resource.

Note: resource projects.agent.knowledgeBases.documents is deprecated, please use projects.knowledgeBases.documents instead.

JSON representation
{
  "name": string,
  "displayName": string,
  "mimeType": string,
  "knowledgeTypes": [
    enum(KnowledgeType)
  ],

  // Union field source can be only one of the following:
  "contentUri": string,
  "content": string,
  "rawContent": string
  // End of list of possible types for union field source.
}
Fields
name

string

The document resource name. The name must be empty when creating a document. Format: projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>.

displayName

string

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

mimeType

string

Required. The MIME type of this document.

knowledgeTypes[]

enum(KnowledgeType)

Required. The knowledge type of document content.

Union field source. Required. The source of this document. source can be only one of the following:
contentUri

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
(deprecated)

string

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 rawContent instead.

rawContent

string (bytes format)

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

A base64-encoded string.

KnowledgeType

The knowledge type of document content.

Enums
KNOWLEDGE_TYPE_UNSPECIFIED The type is unspecified or arbitrary.
FAQ

The document content contains question and answer pairs as either HTML or CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats may fail to be parsed.

CSV must have questions in the first column and answers in the second, with no header. Because of this explicit format, they are always parsed accurately.

EXTRACTIVE_QA Documents for which unstructured text is extracted and used for question answering.

Methods

create

Creates a new document.

delete

Deletes the specified document.

get

Retrieves the specified document.

list

Returns the list of all documents of the knowledge base.

patch

Updates the specified document.

reload

Reloads the specified document from its specified source, content_uri or content.