langchain_community.document_loaders.yuque
.YuqueLoader¶
- class langchain_community.document_loaders.yuque.YuqueLoader(access_token: str, api_url: str = 'https://www.yuque.com')[source]¶
Load documents from Yuque.
Initialize with Yuque access_token and api_url.
- Parameters
access_token (str) – Personal access token - see https://www.yuque.com/settings/tokens.
api_url (str) – Yuque API url.
Attributes
headers
Methods
__init__
(access_token[, api_url])Initialize with Yuque access_token and api_url.
A lazy loader for Documents.
get_books
(user_id)get_document
(book_id, document_id)get_document_ids
(book_id)http_get
(url)A lazy loader for Documents.
load
()Load documents from Yuque.
load_and_split
([text_splitter])Load Documents and split into chunks.
parse_document
(document)parse_document_body
(body)- __init__(access_token: str, api_url: str = 'https://www.yuque.com')[source]¶
Initialize with Yuque access_token and api_url.
- Parameters
access_token (str) – Personal access token - see https://www.yuque.com/settings/tokens.
api_url (str) – Yuque API url.
- async alazy_load() AsyncIterator[Document] ¶
A lazy loader for Documents.
- Return type
AsyncIterator[Document]
- get_document(book_id: int, document_id: int) Dict [source]¶
- Parameters
book_id (int) –
document_id (int) –
- Return type
Dict
- get_document_ids(book_id: int) List[int] [source]¶
- Parameters
book_id (int) –
- Return type
List[int]
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document] ¶
Load Documents and split into chunks. Chunks are returned as Documents.
Do not override this method. It should be considered to be deprecated!
- Parameters
text_splitter (Optional[TextSplitter]) – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns
List of Documents.
- Return type
List[Document]