An interactive chatbot that helps users find and explore products using OpenAI's function calling capabilities.
- Real-time chat interface with loading indicators
- Product search and filtering capabilities:
- Search by title/description
- Filter by maximum price
- Filter by category
- Beautiful product card display
- Responsive design
- Seamless integration with OpenAI's API
- React
- TypeScript
- Netlify Functions (for serverless backend)
- OpenAI API
- Tailwind CSS
- Lucide React (for icons)
/src/components- React components including ChatMessage and ProductCard/data- Product data source/utils- Utility functions including chatbot logic/types- TypeScript type definitions
/netlify/functions- Serverless function handling OpenAI API integration
- Clone the repository
- Install dependencies:
npm install
- Set up environment variables:
Create a
.envfile with:OPENAI_API_KEY=your_api_key_here - Run the development server:
npm run dev
OPENAI_API_KEY- Your OpenAI API key
The chatbot uses OpenAI's function calling to process user queries and return relevant products. The main components are:
- App.tsx - Main chat interface
- openai.ts - OpenAI function calling implementation
- ProductCard.tsx - Product display component
- chatbot.ts - Chat logic and API integration
MIT