From 475892ca0e67ae8c1cc48658e3c5cb99e24596f9 Mon Sep 17 00:00:00 2001 From: Rahul Triptahi Date: Wed, 17 Apr 2024 07:03:10 +0530 Subject: [PATCH] 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 Co-authored-by: Rahul Tripathi --- .../document_loaders/google_drive.ipynb | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/docs/docs/integrations/document_loaders/google_drive.ipynb b/docs/docs/integrations/document_loaders/google_drive.ipynb index f1f59fc6cf..2d11faedad 100644 --- a/docs/docs/integrations/document_loaders/google_drive.ipynb +++ b/docs/docs/integrations/document_loaders/google_drive.ipynb @@ -322,6 +322,52 @@ " 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", "id": "cd13d7d1-db7a-498d-ac98-76ccd9ad9019", @@ -530,7 +576,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.11.5" } }, "nbformat": 4,