A document loader that uses the Unstructured API to load unstructured documents. It supports both the new syntax with options object and the legacy syntax for backward compatibility. The load() method sends a partitioning request to the Unstructured API and retrieves the partitioned elements. It creates a Document instance for each element and returns an array of Document instances.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

filePath: string

Methods

  • Returns Promise<{
        basename: ((path, suffix?) => string);
        readFile: {
            (path, options?): Promise<Buffer>;
            (path, options): Promise<string>;
            (path, options?): Promise<string | Buffer>;
        };
    }>

  • Loads the documents.

    Returns Promise<Document<Record<string, any>>[]>

    A Promise that resolves with an array of Document instances.

  • Loads the documents and splits them using a specified text splitter.

    Parameters

    Returns Promise<Document<Record<string, any>>[]>

    A Promise that resolves with an array of Document instances, each split according to the provided TextSplitter.

Generated using TypeDoc