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.
This message has oneof_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
str
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.
This field is a member of oneof_ source.
content
str
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.
This field is a member of oneof_ source.
raw_content
bytes
The raw content of the document. This field is only
permitted for EXTRACTIVE_QA and FAQ knowledge types.
This field is a member of oneof_ source.
enable_auto_reload
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.
MutableMapping[str, str]
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.
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 (2):
Documents for which unstructured text is
extracted and used for question answering.
ARTICLE_SUGGESTION (3):
The entire document content as a whole can be
used for query results. Only for Contact Center
Solutions on Dialogflow.
AGENT_FACING_SMART_REPLY (4):
The document contains agent-facing Smart
Reply entries.
SMART_REPLY (4):
The legacy enum for agent-facing smart reply
feature.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class Document (2.41.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.41.2 (latest)](/python/docs/reference/dialogflow/latest/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.41.1](/python/docs/reference/dialogflow/2.41.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.40.0](/python/docs/reference/dialogflow/2.40.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.39.1](/python/docs/reference/dialogflow/2.39.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.38.0](/python/docs/reference/dialogflow/2.38.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.37.0](/python/docs/reference/dialogflow/2.37.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.36.0](/python/docs/reference/dialogflow/2.36.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.35.0](/python/docs/reference/dialogflow/2.35.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.34.0](/python/docs/reference/dialogflow/2.34.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.33.0](/python/docs/reference/dialogflow/2.33.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.32.0](/python/docs/reference/dialogflow/2.32.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.30.2](/python/docs/reference/dialogflow/2.30.2/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.29.0](/python/docs/reference/dialogflow/2.29.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.28.3](/python/docs/reference/dialogflow/2.28.3/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.27.0](/python/docs/reference/dialogflow/2.27.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.26.0](/python/docs/reference/dialogflow/2.26.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.25.0](/python/docs/reference/dialogflow/2.25.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.24.1](/python/docs/reference/dialogflow/2.24.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.23.3](/python/docs/reference/dialogflow/2.23.3/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.22.0](/python/docs/reference/dialogflow/2.22.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.21.0](/python/docs/reference/dialogflow/2.21.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.20.0](/python/docs/reference/dialogflow/2.20.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.19.1](/python/docs/reference/dialogflow/2.19.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.18.0](/python/docs/reference/dialogflow/2.18.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.17.0](/python/docs/reference/dialogflow/2.17.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.16.1](/python/docs/reference/dialogflow/2.16.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.15.2](/python/docs/reference/dialogflow/2.15.2/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.14.1](/python/docs/reference/dialogflow/2.14.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.13.0](/python/docs/reference/dialogflow/2.13.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.12.0](/python/docs/reference/dialogflow/2.12.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.11.0](/python/docs/reference/dialogflow/2.11.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.10.0](/python/docs/reference/dialogflow/2.10.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.9.1](/python/docs/reference/dialogflow/2.9.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.8.1](/python/docs/reference/dialogflow/2.8.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.7.1](/python/docs/reference/dialogflow/2.7.1/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.6.0](/python/docs/reference/dialogflow/2.6.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.5.0](/python/docs/reference/dialogflow/2.5.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.4.0](/python/docs/reference/dialogflow/2.4.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.3.0](/python/docs/reference/dialogflow/2.3.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.2.0](/python/docs/reference/dialogflow/2.2.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.1.2](/python/docs/reference/dialogflow/2.1.2/google.cloud.dialogflow_v2beta1.types.Document)\n- [2.0.0](/python/docs/reference/dialogflow/2.0.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [1.1.3](/python/docs/reference/dialogflow/1.1.3/google.cloud.dialogflow_v2beta1.types.Document)\n- [1.0.0](/python/docs/reference/dialogflow/1.0.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [0.8.0](/python/docs/reference/dialogflow/0.8.0/google.cloud.dialogflow_v2beta1.types.Document)\n- [0.7.2](/python/docs/reference/dialogflow/0.7.2/google.cloud.dialogflow_v2beta1.types.Document) \n\n Document(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nA knowledge document to be used by a\nKnowledgeBase.\n\nFor more information, see the `knowledge base\nguide \u003chttps://cloud.google.com/dialogflow/docs/how/knowledge-bases\u003e`__.\n\nNote: The `projects.agent.knowledgeBases.documents` resource is\ndeprecated; only use `projects.knowledgeBases.documents`.\n\nThis message has `oneof`_ fields (mutually exclusive fields).\nFor each oneof, at most one member field can be set at the same time.\nSetting any member of the oneof automatically clears all other\nmembers.\n\n.. _oneof: \u003chttps://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields\u003e\n\nClasses\n-------\n\n### KnowledgeType\n\n KnowledgeType(value)\n\nThe knowledge type of document content. \n\n CSV must have questions in the first column and\n answers in the second, with no header. Because\n of this explicit format, they are always parsed\n accurately.\n EXTRACTIVE_QA (2):\n Documents for which unstructured text is\n extracted and used for question answering.\n ARTICLE_SUGGESTION (3):\n The entire document content as a whole can be\n used for query results. Only for Contact Center\n Solutions on Dialogflow.\n AGENT_FACING_SMART_REPLY (4):\n The document contains agent-facing Smart\n Reply entries.\n SMART_REPLY (4):\n The legacy enum for agent-facing smart reply\n feature.\n\n### MetadataEntry\n\n MetadataEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nThe abstract base class for a message.\n\n### ReloadStatus\n\n ReloadStatus(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nThe status of a reload attempt.\n\n### State\n\n State(value)\n\nPossible states of the document"]]