Nhảy tới nội dung

Class: SimpleDirectoryReader

Read all the documents in a directory. By default, supports the list of file types in the FILE_EXT_TO_READER map.

Implements

Constructors

constructor

new SimpleDirectoryReader(observer?): SimpleDirectoryReader

Parameters

NameType
observer?ReaderCallback

Returns

SimpleDirectoryReader

Defined in

packages/core/src/readers/SimpleDirectoryReader.ts:64

Properties

observer

Private Optional observer: ReaderCallback

Defined in

packages/core/src/readers/SimpleDirectoryReader.ts:64

Methods

doObserverCheck

doObserverCheck(category, name, status, message?): boolean

Parameters

NameType
category"file" | "directory"
namestring
statusReaderStatus
message?string

Returns

boolean

Defined in

packages/core/src/readers/SimpleDirectoryReader.ts:146


loadData

loadData(params): Promise<Document<Metadata>[]>

Parameters

NameType
paramsSimpleDirectoryReaderLoadDataParams

Returns

Promise<Document<Metadata>[]>

Implementation of

BaseReader.loadData

Defined in

packages/core/src/readers/SimpleDirectoryReader.ts:66

loadData(directoryPath): Promise<Document<Metadata>[]>

Parameters

NameType
directoryPathstring

Returns

Promise<Document<Metadata>[]>

Implementation of

BaseReader.loadData

Defined in

packages/core/src/readers/SimpleDirectoryReader.ts:69