chat_bot_llm 0.0.8-prerelease.2 chat_bot_llm: ^0.0.8-prerelease.2 copied to clipboard
A Flutter plugin to integrate ChatBot LLM. This Plugin provides a chat interface to interact with the ChatBot LLM.
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.7
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.