From d4eda9f3965969d89d396e26d04fcaf2529f9431 Mon Sep 17 00:00:00 2001 From: Marcus Schiesser <mail@marcusschiesser.de> Date: Wed, 21 Feb 2024 14:37:13 +0700 Subject: [PATCH] docs: add llamaparse docs (#553) --- apps/docs/docs/modules/data_loader.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/docs/docs/modules/data_loader.mdx b/apps/docs/docs/modules/data_loader.mdx index 8392d2bc0..2bf5b8558 100644 --- a/apps/docs/docs/modules/data_loader.mdx +++ b/apps/docs/docs/modules/data_loader.mdx @@ -5,6 +5,7 @@ sidebar_position: 4 import CodeBlock from "@theme/CodeBlock"; import CodeSource from "!raw-loader!../../../../examples/readers/src/simple-directory-reader"; import CodeSource2 from "!raw-loader!../../../../examples/readers/src/custom-simple-directory-reader"; +import CodeSource3 from "!raw-loader!../../../../examples/readers/src/llamaparse"; # Loader @@ -30,6 +31,18 @@ Or pass new readers for `fileExtToReader` to support more file types. {CodeSource2} </CodeBlock> +### LlamaParse + +LlamaParse is an API created by LlamaIndex to efficiently parse files, e.g. it's great at converting PDF tables into markdown. + +To use it, first login and get an API key from https://cloud.llamaindex.ai. Make sure to store the key in the environment variable `LLAMA_CLOUD_API_KEY`. + +Then, you can use the `LlamaParseReader` class to read a local PDF file and convert it into a markdown document that can be used by LlamaIndex: + +<CodeBlock language="ts">{CodeSource3}</CodeBlock> + +Alternatively, you can set the [`resultType`](../api/classes/LlamaParseReader.md#resulttype) option to `text` to get the parsed document as a text string. + ## API Reference - [SimpleDirectoryReader](../api/classes/SimpleDirectoryReader.md) -- GitLab