Giter VIP home page Giter VIP logo

knowitall0807 / chatbard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from know-it-all-marketing-llc/chatbard

0.0 0.0 0.0 10.46 MB

ChatBard: An Intelligent Customer Service Center App Using PaLM2 APIs

License: MIT License

C++ 4.12% Python 1.47% C 0.26% Objective-C 0.01% Java 0.12% Kotlin 0.02% Dart 4.02% CSS 0.18% Swift 0.35% HTML 0.82% CMake 3.37% Jupyter Notebook 84.98% Dockerfile 0.27%

chatbard's Introduction

ChatBard : An Intelligent Customer Service Center App

The apps use Generative AI and Large Language Models (LLM) specifically PaLM2 APIs.

The table of contents:

First Example: Flutter App / Drat

ChatBard is an intelligent customer service center app powered by Generative AI and large language models (LLM) using PaLM2 APIs. ๐Ÿค–๐Ÿ’ฌ
This demo of Flutter app is designed to inspire you and showcase how ChatBard can revolutionize customer support. It provides a chat interface where users can interact with a chatbot to ask questions and get answers. The app utilizes generative AI and large language models (LLMs), specifically PaLM2 APIs, to understand and respond intelligently to user messages. The demo app analyzes the context and examples provided to respond accurately, making it an invaluable tool for any customer service center.
ChatBard can be easily customized to align with the nature of your business. By modifying the context and examples, you can tailor the chatbot's responses to your specific business requirements and customer interactions.
Screenshots of the app showcase its functionality, including capturing conversations with clients and providing summarized records stored in Firebase. It offers both English and Arabic language support. Note that this is a developed feature in this app by creating a custom REST API for translation. PaLM2 and Bard are still under development and do not yet support the Arabic language.

How does it work?

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.

Features

Key features of ChatBard include:

  • ๐Ÿ“ฑ User-friendly chat interface for seamless communication.
  • ๐Ÿง  Intelligent responses powered by PaLM2 model.
  • ๐Ÿ”ง Easily customizable to align with the nature of your business by modifying the context and examples.
  • ๐ŸŒ Multi-language support (English and Arabic).
  • ๐Ÿ“š Chat history tracking and display in real-time.
  • ๐Ÿ’พ Summarization and saving of conversations to Firebase database for future reference.

Screenshots

Here are some screenshots of the app:

Screenshot 1
A conversation with the client, and after the conversation ends, it is summarized and stored in Firebase.

Screenshot 2
Arabic Bard in a conversation with the client, and after the conversation ends, it is summarized and stored in Firebase. Screenshot 5
On Android mobile: A conversation with the client, and after the conversation ends, it is summarized and stored in Firebase. Screenshot 6
On Android mobile: Arabic Bard in a conversation with the client, and after the conversation ends, it is summarized and stored in Firebase.

Note: It is a developed feature in this app by creating a custom REST API for translation. PaLM2 and Bard are still under development and do not yet support the Arabic language.

Prerequisites

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.

Getting Started

Follow these steps to get started with the app:

  1. Clone the repository to your local machine.
  2. Open the project in your preferred IDE or editor.
  3. Replace the placeholder API credentials in the code with your actual credentials.
  4. Update the Firebase configuration in the code to match your project.
  5. Run flutter pub get in the project directory to install dependencies.
  6. Connect a device or start an emulator. Skip this step if you prefer to use a web browser for displaying the app.
  7. Run the app using flutter run lib/main.dart.

Customize The App

To customize the app according to the nature of your business, you can modify the following variables in the examples.dart file:

  1. 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.

  2. 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.

Usage

  1. Launch the app on a device or emulator.
  2. Enter your message in the text input at the bottom of the screen and press enter.
  3. The app will send your message to the chatbot API and display the response in the chat interface.
  4. Continue the conversation by entering more messages.
  5. To summarize and save the chat session, click on the "Summarize and Save" floating action button.

Second Example: Flask App / Python

Screenshots

Here are some screenshots of the app:

Screenshot 3
A simple UI for the conversation with the clients

Screenshot 7
If the Summarize button clicked, the summary will appear on the bottom

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 Use The Deployment API Endpoints

To interact with the deployed API endpoints, their information below.

/chat

This endpoint allows you to have a conversation with the English Chat Bard model.

Endpoint

  • URL: <Your URL>/chat
  • Method: POST

Request Payload

{
    "message": "User's message in English"
}

Response Payload

{
    "response": "Response from the English Chat Bard model"
}

/summary

This endpoint generates a summary of a conversation between a customer and the English Chat Bard model.

Endpoint

  • URL: <Your URL>/summary
  • Method: POST

Request Payload

{
    "content": "Conversation content in English"
}

Response Payload

{
    "response": "Summary of the conversation in English"
}

Arabic Chat Bard

This section includes endpoints related to the Arabic Chat Bard model.

/chat_ar

This endpoint allows you to have a conversation with the Arabic Chat Bard model.

Endpoint

  • URL: <Your URL>/chat_ar
  • Method: POST

Request Payload

{
  "message": "User's message in Arabic"
}

Response Payload

{
  "response": "Response from the Arabic Chat Bard "
}

/summary_ar

This endpoint generates a summary of a conversation between a customer and the Arabic Chat Bard.

Endpoint

  • URL: <Your URL>/summary_ar
  • Method: POST

Request Payload

{
  "content": "Conversation content in Arabic"
}

Response Payload

{
  "response": "Summary of the conversation in Arabic"
}

/en2ar

This endpoint translates English text to Arabic.

Endpoint

  • URL: <Your URL>/en2ar
  • Method: POST

Request Payload

{
  "response": "English text to be translated"
}

Response Payload

{
  "response": "Translated Arabic text"
}

/ar2en

This endpoint translates Arabic text to English.

Endpoint

  • URL: <Your URL>/ar2en
  • Method: POST

Request Payload

{
  "response": "Arabic text to be translated"
}

Response Payload

{
  "response": "Translated English text"
}

Third Example: Demo via Gradio in Colab / Python

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

Screenshots

Screenshot 4
A simple Demo via Gradio in Colab

I also presented a workshop on this netbook. Here you will find the presentation

Workshop Title Slides Examples
Hands-on with the PaLM2 API to create smart apps Slides

Contributing

Contributions to the app are welcome! If you find any issues or want to add new features, feel free to open a pull request.

License

The app is released under the MIT License.

Further Resources

chatbard's People

Contributors

ruqyai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.