Skip to main content

llama-index packs amazon_product_extraction integration

Project description

Amazon Product Extraction Pack

This LlamaPack provides an example of our Amazon product extraction pack.

It loads in a website URL, screenshots the page. Then we use OpenAI GPT-4V + prompt engineering to extract the screenshot into a structured JSON output.

Check out the notebook here.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack AmazonProductExtractionPack --download-dir ./amazon_product_extraction_pack

You can then inspect the files at ./amazon_product_extraction_pack and use them as a template for your own project.

Code Usage

You can download the pack to a the ./amazon_product_extraction_pack directory:

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
AmazonProductExtractionPack = download_llama_pack(
    "AmazonProductExtractionPack", "./amazon_product_extraction_pack"
)

From here, you can use the pack, or inspect and modify the pack in ./amazon_product_extraction_pack.

Then, you can set up the pack like so:

# create the pack
# get documents from any data loader
amazon_product_extraction_pack = SentenceWindowRetrieverPack(
    amazon_product_page,
)

The run() function is a light wrapper around program().

response = amazon_product_extraction_pack.run()
display(response.dict())

You can also use modules individually.

# get pydantic program
program = amazon_product_extraction_pack.openai_program

# get multi-modal LLM
mm_llm = amazon_product_extraction_pack.openai_mm_llm

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file llama_index_packs_amazon_product_extraction-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_amazon_product_extraction-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a00854fa0c2dafb8cab9b48b60e5e39a0f840171cf3c5b15b626a615d1a2d14b
MD5 617fee4cf2c9f3aaae85eed61c4a8b2a
BLAKE2b-256 26cdd2f80c63acc331ffb5cc8ea246468262b5cff4235853ecd2c7fa47b96137

See more details on using hashes here.

File details

Details for the file llama_index_packs_amazon_product_extraction-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_amazon_product_extraction-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61164a98ba35ffaf43f2d33d542ade2cd417aa4470c6ceea0dc031a7998ff5ba
MD5 c8942daecb695266a3b47e6ec76e1578
BLAKE2b-256 7e978cb8c3e5ff3d635639237b23930b54ccd7878efe09b63ff9c0020b8cf9d8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page