Skip to content

Commit 144f282

Browse files
authored
docs: add example for loading data from LarkSuite wiki. (#21311)
**Description:** Update LarkSuite loader doc to give an example for loading data from LarkSuite wiki. **Issue:** None **Dependencies:** None **Twitter handle:** None
1 parent 682d21c commit 144f282

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

docs/docs/integrations/document_loaders/larksuite.ipynb

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,24 @@
3030
"source": [
3131
"from getpass import getpass\n",
3232
"\n",
33-
"from langchain_community.document_loaders.larksuite import LarkSuiteDocLoader\n",
33+
"from langchain_community.document_loaders.larksuite import (\n",
34+
" LarkSuiteDocLoader,\n",
35+
" LarkSuiteWikiLoader,\n",
36+
")\n",
3437
"\n",
3538
"DOMAIN = input(\"larksuite domain\")\n",
3639
"ACCESS_TOKEN = getpass(\"larksuite tenant_access_token or user_access_token\")\n",
3740
"DOCUMENT_ID = input(\"larksuite document id\")"
3841
]
3942
},
43+
{
44+
"cell_type": "markdown",
45+
"id": "4b6b9a66",
46+
"metadata": {},
47+
"source": [
48+
"## Load From Document"
49+
]
50+
},
4051
{
4152
"cell_type": "code",
4253
"execution_count": 3,
@@ -65,6 +76,38 @@
6576
"pprint(docs)"
6677
]
6778
},
79+
{
80+
"cell_type": "markdown",
81+
"id": "86f4a714",
82+
"metadata": {},
83+
"source": [
84+
"## Load From Wiki"
85+
]
86+
},
87+
{
88+
"cell_type": "code",
89+
"execution_count": 4,
90+
"id": "7332dfb9",
91+
"metadata": {},
92+
"outputs": [
93+
{
94+
"name": "stdout",
95+
"output_type": "stream",
96+
"text": [
97+
"[Document(page_content='Test doc\\nThis is a test wiki doc.\\n', metadata={'document_id': 'TxOKdtMWaoSTDLxYS4ZcdEI7nwc', 'revision_id': 15, 'title': 'Test doc'})]\n"
98+
]
99+
}
100+
],
101+
"source": [
102+
"from pprint import pprint\n",
103+
"\n",
104+
"DOCUMENT_ID = input(\"larksuite wiki id\")\n",
105+
"larksuite_loader = LarkSuiteWikiLoader(DOMAIN, ACCESS_TOKEN, DOCUMENT_ID)\n",
106+
"docs = larksuite_loader.load()\n",
107+
"\n",
108+
"pprint(docs)"
109+
]
110+
},
68111
{
69112
"cell_type": "code",
70113
"execution_count": null,

0 commit comments

Comments
 (0)