How godwinlouie2508/shopai works
ShopAI is a Streamlit shopping assistant: users provide a list by chatting or uploading an image, refine and confirm the extracted items, then search and filter retailer products, choose picks, and review a cart total. The main app coordinates session state, OCR, AI parsing, product search, and result presentation. Product search also includes relevance filtering, sorting, retailer-link lookup, and a “Why?” explanation action. The excerpts show the principal calls; the explanation implementation and parts of shopping search are unsampled, so those internal details are represented at module level.
Main entry points: ShopAI.py Streamlit app flow · shopping.py Product search and ranking · ui.py Page and cart UI · utils.py Image OCR
Components 12
App experience
- Streamlit app flow
ShopAI.py - Page and cart UI
modules/ui.py - Session state
modules/state.py
List intake
- Image OCR
modules/utils.py - AI list parsing
ShopAI.py
Product discovery
- Product search and ranking
modules/shopping.py - Retailer link lookup
modules/shopping.py - Pick explanation
modules/shopping.py
External services
- Azure Vision
- OpenAI
- SerpAPI
Other components
- Shopper
Connections 16
- Shopper → Streamlit app flow: provides list
ShopAI.py - Streamlit app flow → Page and cart UI: sets up
ShopAI.py - Streamlit app flow → Session state: initializes and resets
ShopAI.py - Streamlit app flow → Image OCR: submits image
ShopAI.py - Image OCR → Azure Vision: requests OCR
modules/utils.py - Streamlit app flow → AI list parsing: parses list
ShopAI.py - AI list parsing → OpenAI: requests extraction
ShopAI.py - Streamlit app flow → Product search and ranking: requests product results
ShopAI.py - Product search and ranking → SerpAPI: searches products
modules/shopping.py - Streamlit app flow → Retailer link lookup: gets purchase link
ShopAI.py - Retailer link lookup → SerpAPI: requests seller offers
modules/shopping.py - Streamlit app flow → Pick explanation: requests explanation
ShopAI.py - Streamlit app flow → Page and cart UI: displays cart
ShopAI.py - Page and cart UI → Session state: reads selections
modules/ui.py - Product search and ranking → Retailer link lookup: validates retailer
modules/shopping.py - Streamlit app flow → Shopper: presents picks
ShopAI.py