mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 23:29:21 +00:00
docs: Add Documentation to enable authorized access identities in GoogleDriveLoader. (#20065)
Description: Document update. GoogleDriveLoader: Added documentation for `load_auth` a new argument in document_loaders/GoogleDriveLoader. Dependencies: None Documentation: https://python.langchain.com/docs/integrations/document_loaders/google_drive/ Associated PR: https://github.com/langchain-ai/langchain-google/pull/110 Twitter handle: @rahul_tripathi2 Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com> Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
This commit is contained in:
parent
b78ede2f96
commit
475892ca0e
@ -322,6 +322,52 @@
|
|||||||
" print(doc.page_content.strip()[:60] + \"...\")"
|
" print(doc.page_content.strip()[:60] + \"...\")"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "7bde486a",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Loading auth Identities\n",
|
||||||
|
"\n",
|
||||||
|
"Authorized identities for each file ingested by Google Drive Loader can be loaded along with metadata per Document."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "e1d91045",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from langchain_community.document_loaders import GoogleDriveLoader\n",
|
||||||
|
"\n",
|
||||||
|
"loader = GoogleDriveLoader(\n",
|
||||||
|
" folder_id=folder_id,\n",
|
||||||
|
" load_auth=True,\n",
|
||||||
|
" # Optional: configure whether to load authorized identities for each Document.\n",
|
||||||
|
")\n",
|
||||||
|
"\n",
|
||||||
|
"doc = loader.load()"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "83557b75",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"You can pass load_auth=True, to add Google Drive document access identities to metadata."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "7ac1a43b",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"doc[0].metadata"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "cd13d7d1-db7a-498d-ac98-76ccd9ad9019",
|
"id": "cd13d7d1-db7a-498d-ac98-76ccd9ad9019",
|
||||||
@ -530,7 +576,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.10.12"
|
"version": "3.11.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
Loading…
Reference in New Issue
Block a user