chat_bot_llm
- Add your own AI ChatBot to your Flutter app. You just need to create an assistant in platform.openai.com and add the assistant id to the code.
Features
- View the threads
- Send a message to the assistant and get a response
- Supports Speech to text
- Every message you receive will be read out loud
Platform Support
Android | iOS | MacOS | Web | Linux | Windows |
---|---|---|---|---|---|
✔️ | ✔️ |
Getting started
Add the following to your pubspec.yaml
file:
dependencies:
chat_bot_llm: ^0.0.6
Import the package:
import 'package:chat_bot_llm/chat_bot_llm.dart';
In your main.dart file, add the following code:
void main() async {
await ChatBotLlm.initialize(
"com.chatbotllm.example",
appName,
ASSISTANT_ID,
ASSISTANT_NAME,
);
runApp(MyApp());
}
Android: Add the following to your AndroidManifest.xml
file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.VIBRATE"/>
iOS: Add the following to your Info.plist
file:
<key>NSSpeechRecognitionUsageDescription</key>
<string>The App needs this permission to support Speech-to-text</string>
<key>NSMicrophoneUsageDescription</key>
<string>The App needs this permission to support Speech-to-text</string>
Usage
Initialize the package:
await ChatBotLlm.initialize(
"com.chatbotllm.example",
"Chatbot LLM Example",
ASSISTANT_ID,
ASSISTANT_NAME,
);
Start a Conversation:
String userId = Uuid().v4();
await ChatBotLlm.openConversationScreen(context, userId);
Additional information
Currently, the package is only tested on Android and iOS. If you want to use it on other platforms, please create an issue or contribute by creating a Pull request.
Currently, the Plugin only runs on the app with GetX pattern. We will add support for other patterns soon.
Use our example to get an idea of how to use the package. If you have any questions, please create an issue.
You will need to create an assistant on platform.openai.com and add the assistant id to the code.
You can also click on the "Thumb up" button of the top of the pub.dev page if you find this Package helpfull.
Team CREO IT
Libraries
- app/data/models/message_model/message_model
- app/data/network/api_repo
- app/modules/all_chats/bindings/all_chats_binding
- app/modules/all_chats/controllers/all_chats_controller
- app/modules/all_chats/views/all_chats_view
- app/modules/chat/bindings/chat_binding
- app/modules/chat/controllers/chat_controller
- app/modules/chat/views/chat_view
- app/modules/root_page
- app/routes/app_pages
- chat_bot_llm
- consts/get_storage_keys