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
Hashes for llama_index_packs_amazon_product_extraction-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 357850eaaecf84242cfadb4144cd8519418d9e4f46e2c27b3cf6a257fba1ca18 |
|
MD5 | 70cae3b81bcf5c27e196f52141b288f8 |
|
BLAKE2b-256 | fb50a7c8390e7a2b6cf96a256e0e639b783c23e764ac270664831b0e9f268d7d |
Hashes for llama_index_packs_amazon_product_extraction-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 697ae687a2e098436bb14a7eed780aaf17a3524a4409c84ff71c02e78b4a6185 |
|
MD5 | 130442ea903c95712aaea43d359771a4 |
|
BLAKE2b-256 | a21e318d3594258ac8a16b110a8a62dbea9e802a74672e47b6f007ed3ccf2d5e |