mirror of
https://github.com/run-llama/template-workflow-data-extraction.git
synced 2026-06-29 11:19:16 -04:00
main
Read the opt-in PUBLIC_LLAMA_CLOUD_API_KEY env var and re-export as import.meta.env.VITE_LLAMA_CLOUD_API_KEY for the 5 llama_cloud=true UIs. Server-only LLAMA_CLOUD_API_KEY is no longer the source for client bundles; deployers must explicitly opt in by setting PUBLIC_*.
Data Extraction and Ingestion
This is a starter for LlamaAgents. See the LlamaAgents (llamactl) getting started guide for context on local development and deployment.
To run the application, install uv and run uvx llamactl serve.
Simple customizations
For some basic customizations, you can modify src/extraction_review/config.py
USE_REMOTE_EXTRACTION_SCHEMA: Set toFalseto define your own PydanticExtractionSchemain this file. Set toTrueto reuse the schema from an existing LlamaCloud Extraction Agent.EXTRACTION_AGENT_NAME: Logical name for your Extraction Agent. WhenUSE_REMOTE_EXTRACTION_SCHEMAisFalse, this name is used to upsert the agent with your local schema; whenTrue, it is used to fetch an existing agent.EXTRACTED_DATA_COLLECTION: The Agent Data collection name used to store extractions (namespaced by agent name and environment).ExtractionSchema: When using a local schema, edit this Pydantic model to match the fields you want extracted. Prefer optional types where possible to allow for partial extractions.
The UI fetches the JSON Schema and collection name from the backend metadata workflow at runtime, and dynamically generates an editing UI based on the schema.
Complex customizations
For more complex customizations, you can edit the rest of the application. For example, you could
- Modify the existing file processing workflow to provide additional context for the extraction process
- Take further action based on the extracted data.
- Add additional workflows to submit data upon approval.
Linting and type checking
Python and javascript packages contain helpful scripts to lint, format, and type check the code.
To check and fix python code:
uv run hatch run lint
uv run hatch run typecheck
uv run hatch run test
# run all at once
uv run hatch run all-fix
To check and fix javascript code, within the ui directory:
pnpm run lint
pnpm run typecheck
pnpm run test
# run all at once
pnpm run all-fix
Description
Languages
TypeScript
54.9%
Python
34.9%
CSS
9.2%
HTML
0.6%
Jinja
0.2%
Other
0.2%