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

Attributes

headers

Methods

__init__(access_token[, api_url])

Initialize with Yuque access_token and api_url.

alazy_load()

A lazy loader for Documents.

get_books(user_id)

get_document(book_id, document_id)

get_document_ids(book_id)

get_documents()

get_user_id()

http_get(url)

lazy_load()

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
async alazy_load() AsyncIterator[Document]¶

A lazy loader for Documents.

Return type

AsyncIterator[Document]

get_books(user_id: int) List[Dict][source]¶
Parameters

user_id (int) –

Return type

List[Dict]

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]

get_documents() Iterator[Document][source]¶
Return type

Iterator[Document]

get_user_id() int[source]¶
Return type

int

http_get(url: str) Dict[source]¶
Parameters

url (str) –

Return type

Dict

lazy_load() Iterator[Document]¶

A lazy loader for Documents.

Return type

Iterator[Document]

load() List[Document][source]¶

Load documents from Yuque.

Return type

List[Document]

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]

parse_document(document: Dict) Document[source]¶
Parameters

document (Dict) –

Return type

Document

static parse_document_body(body: str) str[source]¶
Parameters

body (str) –

Return type

str