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.

aload()

Load data into Document objects.

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]

async aload() β†’ list[Document]#

Load data into Document objects.

Return type:

list[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: TextSplitter | None = 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

Examples using YuqueLoader