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.2.0.tar.gz
.
File metadata
- Download URL: llama_index_packs_amazon_product_extraction-0.2.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2283e1bea314210789d0075eba416c99da651f1819a1e5b7f693c4c7f2fe220 |
|
MD5 | 7e19a80a3c7591ef9c50cf6b0a4cd333 |
|
BLAKE2b-256 | de24d80880d16be2007ecfb8594020fe28a69b85d85773f9fd64e4ed95caa919 |
File details
Details for the file llama_index_packs_amazon_product_extraction-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_packs_amazon_product_extraction-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e008cc2060d7f0e6c6f8f718b608f19a8bef2297f24f34a32740d4dc71536f |
|
MD5 | 71d2f59772b6f471b75c44bfd4038c37 |
|
BLAKE2b-256 | 41609676d835f37f77dcac012e280f9cb957d49f2135b743f2d8a0d55247c9e8 |