Skip to content

Commit

Permalink
docs: add example for loading data from LarkSuite wiki. (#21311)
Browse files Browse the repository at this point in the history
**Description:** Update LarkSuite loader doc to give an example for
loading data from LarkSuite wiki.
**Issue:** None
**Dependencies:** None
**Twitter handle:** None
  • Loading branch information
pcliupc committed May 6, 2024
1 parent 682d21c commit 144f282
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion docs/docs/integrations/document_loaders/larksuite.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,24 @@
"source": [
"from getpass import getpass\n",
"\n",
"from langchain_community.document_loaders.larksuite import LarkSuiteDocLoader\n",
"from langchain_community.document_loaders.larksuite import (\n",
" LarkSuiteDocLoader,\n",
" LarkSuiteWikiLoader,\n",
")\n",
"\n",
"DOMAIN = input(\"larksuite domain\")\n",
"ACCESS_TOKEN = getpass(\"larksuite tenant_access_token or user_access_token\")\n",
"DOCUMENT_ID = input(\"larksuite document id\")"
]
},
{
"cell_type": "markdown",
"id": "4b6b9a66",
"metadata": {},
"source": [
"## Load From Document"
]
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down Expand Up @@ -65,6 +76,38 @@
"pprint(docs)"
]
},
{
"cell_type": "markdown",
"id": "86f4a714",
"metadata": {},
"source": [
"## Load From Wiki"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7332dfb9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Document(page_content='Test doc\\nThis is a test wiki doc.\\n', metadata={'document_id': 'TxOKdtMWaoSTDLxYS4ZcdEI7nwc', 'revision_id': 15, 'title': 'Test doc'})]\n"
]
}
],
"source": [
"from pprint import pprint\n",
"\n",
"DOCUMENT_ID = input(\"larksuite wiki id\")\n",
"larksuite_loader = LarkSuiteWikiLoader(DOMAIN, ACCESS_TOKEN, DOCUMENT_ID)\n",
"docs = larksuite_loader.load()\n",
"\n",
"pprint(docs)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 144f282

Please sign in to comment.