mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
1fad39be1c
**Description:** Add LarkSuite wiki document loader. Refer to [LarkSuite api document ](https://open.feishu.cn/document/server-docs/docs/wiki-v2/space-node/list)for details. **Issue:** None **Dependencies:** None **Twitter handle:** None
27 lines
672 B
Python
27 lines
672 B
Python
from langchain_community.document_loaders.larksuite import (
|
|
LarkSuiteDocLoader,
|
|
LarkSuiteWikiLoader,
|
|
)
|
|
|
|
DOMAIN = ""
|
|
ACCESS_TOKEN = ""
|
|
DOCUMENT_ID = ""
|
|
|
|
|
|
def test_larksuite_doc_loader() -> None:
|
|
"""Test LarkSuite (FeiShu) document loader."""
|
|
loader = LarkSuiteDocLoader(DOMAIN, ACCESS_TOKEN, DOCUMENT_ID)
|
|
docs = loader.load()
|
|
|
|
assert len(docs) == 1
|
|
assert docs[0].page_content is not None
|
|
|
|
|
|
def test_larksuite_wiki_loader() -> None:
|
|
"""Test LarkSuite (FeiShu) wiki loader."""
|
|
loader = LarkSuiteWikiLoader(DOMAIN, ACCESS_TOKEN, DOCUMENT_ID)
|
|
docs = loader.load()
|
|
|
|
assert len(docs) == 1
|
|
assert docs[0].page_content is not None
|