mirror of
https://github.com/run-llama/llama_cloud_services.git
synced 2026-07-22 04:25:22 -04:00
e6a27d17fb
* wip: implementing Extract in TS * feat: main implementation (untested) * ci: lint * feat: add stateless api support and retries mechanisms * refactor: working LlamaExtract + tests * refactor: working LlamaExtract + tests * correct stateless extraction test * correct stateless extraction test * chore: intervals are now in seconds, extractStateless -> extract, support for multiple file types * fix: infer file type * fix: infer file type * fix: change agent name * docs: adding example * docs: add link to example in extract.md
LlamaParse Demo
A TypeScript demo application showcasing the power of LlamaParse - an intelligent document parsing service from LlamaCloud. This demo allows you to parse various document formats and generate AI-powered summaries using OpenAI's GPT models.
Table of Contents
- Features
- Prerequisites
- Installation
- Usage
- How It Works
- API Dependencies
- Troubleshooting
- License
- Contributing
Features
- 📄 Document Parsing: Parse PDFs, Word docs, and other formats using LlamaParse
- 🤖 AI Summaries: Generate intelligent summaries using OpenAI GPT-4
- 🎨 Beautiful CLI: Styled console interface with colors and ASCII art
- ⚡ Fast Development: Hot reload support with watch mode
- 🛠️ TypeScript: Full TypeScript support with strict type checking
Prerequisites
- Node.js (version 18 or higher)
- pnpm package manager
- OpenAI API key
- LlamaCloud API key
Installation
- Clone the repository:
git clone https://github.com/run-llama/llama_cloud_services
cd lama_cloud_services/examples-ts/parse/
- Install dependencies:
pnpm install
- Set up your environment variables:
# Add your API keys to your environment
export OPENAI_API_KEY="your-openai-api-key"
export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"
Usage
Start the Demo
pnpm run start
The application will display a welcome screen and prompt you to enter the path to a document you'd like to process.
Development Mode
For development with hot reload:
pnpm run dev
Build the Project
pnpm run build
Code Quality
Format code:
pnpm run format
Lint code:
pnpm run lint
How It Works
- Document Input: Enter the path to your document when prompted
- Parsing: LlamaParse processes the document and extracts structured content
- AI Summary: The extracted content is sent to OpenAI GPT-4 for summarization
- Results: View the AI-generated summary in your terminal
Troubleshooting
Common Issues
- Module Resolution Errors: Ensure you're using Node.js 18+ and have all dependencies installed
- API Key Issues: Verify your OpenAI and LlamaCloud API keys are correctly set
- File Path Errors: Use absolute paths or ensure relative paths are correct from the project root
License
MIT License - see the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run
pnpm run formatandpnpm run lint - Submit a pull request