A very simple chatbot application using OpenAI API that can be deployed to multiple platforms like web, desktop and mobile with Flutter. A Flutter project with chat ui and using OpenAI API service.
Refer the youtube video for a full walkthrough with key concepts on how to build a multi-platform chatbot with OpenAI and Flutter. Video Tutorial: Build Your Own Multi-Platform Chatbot with OpenAI and Flutter | Easy Step-by-Step Guide
Obtain your OpenAI API key and replace the key in openai_service.dart file. static const apiKey = '';
Modify the openai_service.ChatGPTAPI function to include your own prompt or context for the API.
{ "role": "user", "content": ".$prompt", }
This project uses the following flutter packages https://pub.dev/packages/flutter_chat_ui The package acts as a main source to design the chat interface. Credits to the developers for creating an amazing and simple package to easily build chat interfaces.
Note: This project is for learning purposes to easily understand the differnt modules involved in build a chatbot from scratch. Please follow the packages for more information and follow best practices when building your application.
This project is a starting point for a Chatbot Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.