From a64a1943fdf65824b10b5e2d48fb4684fa4b6e77 Mon Sep 17 00:00:00 2001 From: Rahul Triptahi Date: Mon, 29 Apr 2024 21:11:57 +0530 Subject: [PATCH] docs: Document update for load_extended_matadata in GoogleDriveLoader (#20950) Document: Updated google_drive,ipynb for loading following extended metadata. - full_path - Full path of the file/s in google drive. - owner - owner of the file/s. - size - size of the file/s. Code changes: [langchain-google/pull/179.](https://github.com/langchain-ai/langchain-google/pull/179) Signed-off-by: Rahul Tripathi Co-authored-by: Rahul Tripathi Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> --- .../document_loaders/google_drive.ipynb | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/docs/integrations/document_loaders/google_drive.ipynb b/docs/docs/integrations/document_loaders/google_drive.ipynb index fd793d368f0..2e5dcba8b1d 100644 --- a/docs/docs/integrations/document_loaders/google_drive.ipynb +++ b/docs/docs/integrations/document_loaders/google_drive.ipynb @@ -368,6 +368,54 @@ "doc[0].metadata" ] }, + { + "cell_type": "markdown", + "id": "5ae0a525", + "metadata": {}, + "source": [ + "### Loading extended metadata\n", + "Following extra fields can also be fetched within metadata of each Document:\n", + " - full_path - Full path of the file/s in google drive.\n", + " - owner - owner of the file/s.\n", + " - size - size of the file/s." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6c0db38c", + "metadata": {}, + "outputs": [], + "source": [ + "from langchain_google_community import GoogleDriveLoader\n", + "\n", + "loader = GoogleDriveLoader(\n", + " folder_id=folder_id,\n", + " load_extended_matadata=True,\n", + " # Optional: configure whether to load extended metadata for each Document.\n", + ")\n", + "\n", + "doc = loader.load()" + ] + }, + { + "cell_type": "markdown", + "id": "826d88a7", + "metadata": {}, + "source": [ + "You can pass load_extended_matadata=True, to add Google Drive document extended details to metadata." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fdaf04e4", + "metadata": {}, + "outputs": [], + "source": [ + "doc[0].metadata" + ] + }, { "cell_type": "markdown", "id": "cd13d7d1-db7a-498d-ac98-76ccd9ad9019",