This is a simple Flutter app that demonstrates how to integrate OpenAI's GPT-3.5 model with a chat UI using the flutter_chat_ui and flutter_chat_types libraries. The app allows users to send messages to a chatbot powered by GPT-3.5 and receive responses in real time.
Before you begin, ensure that you have the following:
- Flutter SDK installed on your machine.
- An OpenAI API key with access to the GPT-3.5 model.
Clone this repository to your local machine.
Navigate to the project directory and run flutter pub get
to install the necessary dependencies.
Replace the openAiAPIKey constant in the main.dart file with your OpenAI API key, or run the project with the dart-define
CLI option.
Connect your device or start an emulator and run flutter run to start the app.
Props to the Flutter chat ui package from the Flyer team for making this chat ui very easy to do.