The apps use Generative AI and Large Language Models (LLM) specifically PaLM2 APIs.
This is a Flutter app for an intelligent customer service center. It provides a chat interface where users can interact with a chatbot to get customer support. The app uses Generative AI and Large Language Models (LLM) specifically PaLM2 APIs to understand and respond to user messages.
The ChatBARD responds to customer queries based on the information it has been fed with in terms of context and examples. Then it summarizes the conversation and stores the summary in the database in Firebase.
- Chat interface: Users can send messages and receive responses from the chatbot.
- Intelligent responses: The app uses a machine learning model to generate intelligent responses based on the user's input.
- Chat history: The app keeps track of the chat history and displays it in the chat interface.
- Summarization and saving: The app can summarize the chat session and save it to a Firebase database for future reference.
Here are some screenshots of the app:
A conversation with the client, and after the conversation ends, it is summarized and stored in Firebase.
Arabic Bard in a conversation with the client, and after the conversation ends, it is summarized and stored in Firebase.
Before running the app, make sure you have the following:
- Flutter SDK installed on your machine.
- A valid Firebase project with Firestore enabled.
- API credentials for the PaLM APIs of chat and text summarization used in the code.
Follow these steps to get started with the app:
- Clone the repository to your local machine.
- Open the project in your preferred IDE or editor.
- Replace the placeholder API credentials in the code with your actual credentials.
- Update the Firebase configuration in the code to match your project.
- Run
flutter pub get
in the project directory to install dependencies. - Connect a device or start an emulator. Skip this step if you prefer to use a web browser for displaying the app.
- Run the app using
flutter run lib/main.dart
.
To customize the app according to the nature of your business, you can modify the following variables in the examples.dart
file:
-
context
: This variable represents the context and scope of your business. Update it with a brief description that reflects the purpose and domain of your customer service center. -
examples
: This variable contains example conversations that include important information relevant to your business. These examples help learn the chatbot model to understand and respond accurately to user queries.
By updating the context
and examples
variables with relevant information, you can tailor the chatbot's responses to align with your business's specific requirements and customer interactions.
Feel free to modify other parts of the code or user interface to meet your needs.
- Launch the app on a device or emulator.
- Enter your message in the text input at the bottom of the screen and press enter.
- The app will send your message to the chatbot API and display the response in the chat interface.
- Continue the conversation by entering more messages.
- To summarize and save the chat session, click on the "Summarize and Save" floating action button.
- Try it here
Here are some screenshots of the app:
A simple UI for the conversation with the clients
This is a step-by-step guide to deploying a Python-based REST API on Cloud Run. The guide follows the instructions provided in the official Cloud Run documentation here.
To interact with the deployed API endpoints, their information below. FYI, these endpoints will be deleted after one month.
This endpoint allows you to have a conversation with the English Chat Bard model.
- URL:
https://chat-btfpe7ljtq-uc.a.run.app/chat
- Method: POST
{
"message": "User's message in English"
}
{
"response": "Response from the English Chat Bard model"
}
This endpoint generates a summary of a conversation between a customer and the English Chat Bard model.
- URL:
https://chat-btfpe7ljtq-uc.a.run.app/summary
- Method: POST
{
"content": "Conversation content in English"
}
{
"response": "Summary of the conversation in English"
}
This section includes endpoints related to the Arabic Chat Bard model.
This endpoint allows you to have a conversation with the Arabic Chat Bard model.
- URL:
https://chat-btfpe7ljtq-uc.a.run.app/chat_ar
- Method: POST
{
"message": "User's message in Arabic"
}
{
"response": "Response from the Arabic Chat Bard "
}
This endpoint generates a summary of a conversation between a customer and the Arabic Chat Bard.
- URL:
https://chat-btfpe7ljtq-uc.a.run.app/summary_ar
- Method: POST
{
"content": "Conversation content in Arabic"
}
{
"response": "Summary of the conversation in Arabic"
}
This endpoint translates English text to Arabic.
- URL:
https://chat-btfpe7ljtq-uc.a.run.app/en2ar
- Method: POST
{
"response": "English text to be translated"
}
{
"response": "Translated Arabic text"
}
This endpoint translates Arabic text to English.
- URL:
https://chat-btfpe7ljtq-uc.a.run.app/ar2en
- Method: POST
{
"response": "Arabic text to be translated"
}
{
"response": "Translated English text"
}
Feel free to use these endpoints to interact with the deployed REST API. NOTE: These endpoints will be deleted after one month.
Google Colab is a powerful online platform and easy to use. It provides a simple and convenient way to demonstrate code, create tutorials, and review demos. Take a look
Contributions to the app are welcome! If you find any issues or want to add new features, feel free to open a pull request.
The app is released under the MIT License.