Skip to main content

Class: abstract FileReader

A FileReader takes file paths and imports data into Document objects.

Extended by

Implements

Constructors

new FileReader()

new FileReader(): FileReader

Returns

FileReader

Methods

loadData()

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

Parameters

filePath: string

Returns

Promise <Document <Metadata>[]>

Implementation of

BaseReader . loadData

Source

packages/llamaindex/src/readers/type.ts:20


loadDataAsContent()

abstract loadDataAsContent(fileContent, fileName?): Promise <Document <Metadata>[]>

Parameters

fileContent: Buffer

fileName?: string

Returns

Promise <Document <Metadata>[]>

Source

packages/llamaindex/src/readers/type.ts:15


addMetaData()

static addMetaData(filePath): (doc, index) => void

Parameters

filePath: string

Returns

Function

Parameters

doc: Document <Metadata>

index: number

Returns

void

Source

packages/llamaindex/src/readers/type.ts:28