mirror of
https://github.com/run-llama/llama_cloud_services.git
synced 2026-07-22 12:35:50 -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
LlamaExtract Demo
A TypeScript demo application showcasing the power of LlamaExract - a structured data extraction agentic service from LlamaCloud. This demo allows you to extract structured information from scientific papers and get them into a nice markdown format.
Table of Contents
- Features
- Prerequisites
- Installation
- Usage
- How It Works
- API Dependencies
- Troubleshooting
- License
- Contributing
Features
- 📄 Structured Data Extraction: Extract data from your files effortlessly, and structure them the way you want!
- 🤖 Markdown Rendering: Generate markdown directly from your extracted data
- 🎨 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
- LlamaCloud API key
Installation
- Clone the repository:
git clone https://github.com/run-llama/llama_cloud_services
cd lama_cloud_services/examples-ts/extract/
- Install dependencies:
npm install
- Set up your environment variables:
# Add your API key to your environment
export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"
Usage
Start the Demo
npm 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:
npm run dev
Build the Project
npm run build
Code Quality
Format code:
npm run format
Lint code:
npm run lint
How It Works
- Document Input: Enter the path to your document when prompted
- Parsing: LlamaExtract, based on the schema you can find here, processes the document and extracts structured data
- Markdown Rendering: The extracted content is rendered into beautiful markdown
- Results: View the results directly 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 LlamaCloud API key is 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
npm run formatandnpm run lint - Submit a pull request