Published Aug 2023
plasticlist.org samples dataset (2024)
OpenAI GPT-4o model
version: v1beta1
kind: Spicepod
name: plasticlist
datasets:
# - from: https://www.plasticlist.org/downloads/samples.tsv
# name: samples
# description: plasticlist.org samples dataset (2024) accelerated with Spice
# acceleration:
# enabled: true
# - from: file:./samples.csv
- from: https://raw.githubusercontent.com/ewgenius/plasticlist/refs/heads/main/samples.csv
name: samples
description: plasticlist.org samples dataset (2024)
acceleration:
enabled: true
metadata:
instructions: |
The `samples` dataset contains a list of samples from plasticlist.org.
Provide product reference using product_id and https://www.plasticlist.org/product/<product_id>
product_id: 1 -> https://www.plasticlist.org/product/1
product_id: 123 -> https://www.plasticlist.org/product/123
Provide product image url using product_id and https://www.plasticlist.org/images/products/<XXXX>.jpg template, where XXXX is zero-padded product_id, e.g.
product_id: 1 -> https://www.plasticlist.org/images/products/0001.jpg
product_id: 123 -> https://www.plasticlist.org/images/products/0123.jpg
reference_url_template: https://www.plasticlist.org/product/<product_id>
image_url_template: https://www.plasticlist.org/images/products/<XXXX>.jpg
columns:
- name: id
description: Sample unique ID
- name: product
description: The product tested including brand, name, and description
embeddings:
- from: openai_embeddings
row_id:
- product_id
- name: tags
description: Tags associated with the product
- name: DEHP_equivalents_ng_g
description: Bis(2-ethylhexyl) phthalate (DEHP) equivalents in ng/g
- name: DEHP_ng_g
description: Bis(2-ethylhexyl) phthalate (DEHP) in ng/g
- name: DBP_ng_g
description: Dibutyl phthalate (DBP) in ng/g
- name: BBP_ng_g
description: Benzyl butyl phthalate (BBP) in ng/g
- name: DIBP_ng_g
description: Diisobutyl phthalate (DIBP) in ng/g
- name: DINP_ng_g
description: Diisononyl phthalate (DINP) in ng/g
- name: DIDP_ng_g
description: Diisodecyl phthalate (DIDP) in ng/g
- name: BPA_ng_g
description: Bisphenol A (BPA) in ng/g
- name: BPS_ng_g
description: Bisphenol S (BPS) in ng/g
models:
- from: openai:gpt-4o
name: gpt4o
description: OpenAI GPT-4o model
params:
tools: auto, memory
openai_api_key: ${ secrets:OPENAI_API_KEY }
system_prompt: |
You are an AI assistant created by Spice AI (spice.ai) helping a user with a question about plastic chemicals in food products based on the plasticlist.org `samples` dataset.
Always be specific and provide the data in answers.
When referencing products, favor the aggregate of samples for each unique product and provide the plasticlist.org URL as a citation and show product image.
## Attribution
PlasticList. 'Data on Plastic Chemicals in Bay Area Foods'. plasticlist.org. Accessed Dec 31, 2024.
embeddings:
- from: openai
name: openai_embeddings
params:
openai_api_key: ${ secrets:OPENAI_API_KEY }
datasets:
- samples
This repository contains a Spice application for plasticlist.org, enabling super-fast SQL queries, vector searches, and LLM-based chat interactions over the dataset.
Clone this repository and navigate to the project directory:
git clone https://github.com/spiceai/plasticlist.git
cd plasticlist
Set up your .env.local file:
cp .env .env.local
# Edit the .env.local file to include your API key and other required configurations.
Run Spice. Ensure the working directory is plasticlist:
spice run
This will set up the datasets and the configured LLM model for queries and searches.
spice sqlUse the spice sql command to run SQL queries against the datasets. For example, to query the samples dataset:
spice sql
> SELECT * FROM samples WHERE category = 'plastic' LIMIT 10;
This retrieves up to 10 records where the category is "plastic."
spice searchPerform vector-based searches using the spice search command. Example:
spice search
search> Whole Foods
This finds results related to ocean pollution prevention from the dataset.
spice chatEngage with the dataset through an LLM using the spice chat command. Example:
spice chat
chat> What are the most common types of plastic in the dataset?
The LLM will generate a response based on the dataset and the GPT model configured in the spicepod.yml file.
spicepod.yml file to add new datasets or models.This project is licensed under the MIT License. See the LICENSE file for details.
Published Aug 2023
Published Apr 2024
Published Sep 2024
Published Sep 2024