Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopSmart AI Chatbot

AI-powered e-commerce shopping assistant that answers product-related questions using LLM APIs.

Features

  • Natural language product Q&A over a sample catalog
  • Switchable LLM backend (OpenAI, Google Gemini) via environment variable
  • Clean provider abstraction -- easy to add new LLM providers
  • Type-safe configuration with Pydantic

Quick Start

1. Install

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e .

2. Configure

cp .env.example .env

Edit .env with your API key:

LLM_PROVIDER=gemini
LLM_MODEL=gemini-2.0-flash
API_KEY=your-api-key-here

Gemini (free tier): Get a key at Google AI Studio (aistudio.google.com/apikey)

OpenAI: Set LLM_PROVIDER=openai, LLM_MODEL=gpt-4o-mini, and use your OpenAI key.

3. Run

python -m src.main

Example Conversation

ShopSmart Assistant (gemini/gemini-2.0-flash)
Type 'quit' to exit.

You: Do you have red shoes under $50?

Assistant: Yes! We have the **Classic Canvas Sneaker** in red for $39.99.
It comes in sizes 7-11. Would you like to know more?

You: What sizes are available for the Leather Ankle Boot?

Assistant: The **Leather Ankle Boot** is available in sizes 6, 7, 8, and 9.
It comes in black and brown, priced at $89.99.

Project Structure

src/
  main.py              # CLI entry point
  config.py             # Settings from .env
  models.py             # Product data model
  product_store.py      # Product loading and formatting
  prompts.py            # System prompt template
  llm/
    base.py             # LLMProvider protocol
    openai_provider.py  # OpenAI implementation
    gemini_provider.py  # Gemini implementation
    factory.py          # Provider factory
data/
  products.json         # Sample product catalog

Switching LLM Providers

Change LLM_PROVIDER and LLM_MODEL in your .env file:

Provider LLM_PROVIDER LLM_MODEL Notes
Gemini gemini gemini-2.0-flash Free tier available
OpenAI openai gpt-4o-mini Requires paid API key

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages