Neeraj Pradhan fe27ee45fe fix tests
2025-01-16 22:57:12 -08:00
2025-01-16 20:49:03 -08:00
2025-01-15 17:33:57 -08:00
2025-01-16 20:49:03 -08:00
2025-01-16 22:32:06 -08:00
2025-01-16 22:57:12 -08:00
2025-01-15 17:23:52 -08:00
2025-01-16 18:19:58 -08:00
2024-07-23 13:29:03 -03:00
2025-01-15 17:23:52 -08:00
2025-01-16 18:19:58 -08:00
2025-01-15 17:23:52 -08:00

LlamaExtract (EXPERIMENTAL)

LlamaExtract provides a simple API for extracting structured data from unstructured text.

⚠️ Warning 🚧

The released version of LlamaExtract on PyPi is no longer supported. This library is under active development and we will share an updated version on PyPi very soon. In the meantime, please do not use this code on Github. If you are interested in being an early adopter, please contact us at support@llamaindex.ai or reach out on Discord.

🚧

Installation

# Warning: Contains breaking changes
pip install llama-extract==0.1.0

Usage

Create a LlamaExtract client

extractor = LlamaExtract(api_key="YOUR_API_KEY")

Create an agent

agent = extractor.create_agent(
    name="test_agent",
    data_schema={
        "type": "object",
        "properties": {
            "name": {"type": "string"},
            "email": {"type": "string"},
        },
        "required": ["name", "email"],
    },
)

You can also pass in a Pydantic model to define the data schema.

from pydantic import BaseModel


class Resume(BaseModel):
    name: str
    email: str


agent = extractor.create_agent(name="test_agent", data_schema=Resume)

Extract data from a file

result = await agent.aextract("path/to/resume.pdf")

For a more detailed example and an illustration of usage patterns, please refer to the demo notebook.

S
Description
No description provided
Readme 2.3 MiB
Latest
2025-01-28 23:47:46 -05:00