A Flutter-based chatbot application that provides information about car models, specifications, features, and pricing using OpenAI's GPT-4 API. This is a demo application that can be easily adapted for use in any field by modifying the system instructions in the OpenAI service.
- Real-time chat interface
- Stream-based responses for better user experience
- Detailed information about car models
- Technical specifications
- Features and options
- Pricing and availability
- Model comparisons
- Flutter SDK
- OpenAI API key
- Dart SDK
- Clone the repository:
git clone <https://github.com/umaraslam-cs/chatbot-demo.git>
cd chatbot-demo
- Install dependencies:
flutter pub get
- Create a
.env
file in the root directory of the project:
touch .env
- Add your OpenAI API key to the
.env
file:
OPENAI_API_KEY=your_api_key_here
Replace your_api_key_here
with your actual OpenAI API key. You can get an API key by:
- Going to OpenAI's platform
- Creating an account or signing in
- Navigating to the API keys section
- Creating a new API key
- Make sure you have set up your
.env
file with the API key - Run the application:
flutter run
- Never commit your
.env
file to version control - Keep your API key secure and don't share it publicly
- The chatbot uses GPT-4 model for generating responses
- The system is configured to provide car showroom-specific information
The chatbot can be easily adapted for use in any field by modifying the system instructions in the OpenAIService
class. The instructions are located in the content
parameter of the system message in lib/services/openai_service.dart
. Simply update the instructions to match your desired use case, and the chatbot will respond accordingly.
For example, to change it from a car showroom chatbot to a restaurant chatbot, you would modify the system instructions to include information about:
- Menu items and prices
- Operating hours
- Reservation policies
- Special offers
- Dietary restrictions
- And other restaurant-specific details
If you're new to Flutter, check out these resources: