Class: LlamaParseReader
Represents a reader for parsing files using the LlamaParse API. See https://github.com/run-llama/llama_parse
Extends
Constructors
new LlamaParseReader()
new LlamaParseReader(
params
):LlamaParseReader
Parameters
• params: Partial
<LlamaParseReader
>= {}
Returns
Overrides
Source
packages/core/src/readers/LlamaParseReader.ts:143
Properties
apiKey
apiKey:
string
Source
packages/core/src/readers/LlamaParseReader.ts:110
baseUrl
baseUrl:
string
="https://api.cloud.llamaindex.ai/api/parsing"
Source
packages/core/src/readers/LlamaParseReader.ts:112
checkInterval
checkInterval:
number
=1
Source
packages/core/src/readers/LlamaParseReader.ts:116
doNotCache?
optional
doNotCache:boolean
Source
packages/core/src/readers/LlamaParseReader.ts:130
doNotUnrollColumns?
optional
doNotUnrollColumns:boolean
Source
packages/core/src/readers/LlamaParseReader.ts:134
fastMode?
optional
fastMode:boolean
Source
packages/core/src/readers/LlamaParseReader.ts:132
gpt4oApiKey?
optional
gpt4oApiKey:string
Source
packages/core/src/readers/LlamaParseReader.ts:140
gpt4oMode
gpt4oMode:
boolean
=false
Source
packages/core/src/readers/LlamaParseReader.ts:138
invalidateCache?
optional
invalidateCache:boolean
Source
packages/core/src/readers/LlamaParseReader.ts:128
language
language:
Language
="en"
Source
packages/core/src/readers/LlamaParseReader.ts:122
maxTimeout
maxTimeout:
number
=2000
Source
packages/core/src/readers/LlamaParseReader.ts:118
pageSeperator?
optional
pageSeperator:string
Source
packages/core/src/readers/LlamaParseReader.ts:136
parsingInstruction?
optional
parsingInstruction:string
Source
packages/core/src/readers/LlamaParseReader.ts:124
resultType
resultType:
ResultType
="text"
Source
packages/core/src/readers/LlamaParseReader.ts:114
skipDiagonalText?
optional
skipDiagonalText:boolean
Source
packages/core/src/readers/LlamaParseReader.ts:126
verbose
verbose:
boolean
=true
Source
packages/core/src/readers/LlamaParseReader.ts:120
Methods
createJob()
private
createJob(data
):Promise
<string
>
Parameters
• data: Buffer
Returns
Promise
<string
>
Source
packages/core/src/readers/LlamaParseReader.ts:163
getImages()
getImages(
jsonResult
,downloadPath
):Promise
<Record
<string
,any
>[]>
Downloads and saves images from a given JSON result to a specified download path. Currently only supports resultType = "json"
Parameters
• jsonResult: Record
<string
, any
>[]
The JSON result containing image information.
• downloadPath: string
The path to save the downloaded images.
Returns
Promise
<Record
<string
, any
>[]>
A Promise that resolves to an array of image objects.
Source
packages/core/src/readers/LlamaParseReader.ts:322
getJobResult()
private
getJobResult(jobId
,resultType
):Promise
<any
>
Parameters
• jobId: string
• resultType: string
Returns
Promise
<any
>