Skip to content

A chatgpt-based linebot for teaching badminton rules.

License

Notifications You must be signed in to change notification settings

HeavenAQ/gpt-chatbot

Repository files navigation

Introduction

This repository is designed for educators or individuals interested in incorporating GPT-4 or their customized GPT assistants into teaching pedagogies. It utilizes the LINE Official Account and LINE Developers platforms to create an educational LINE Bot. By employing teachers' LINE official accounts as a medium, this platform enables students to interact with teachers' custom GPTs via their personal LINE accounts. Additionally, it allows teachers to monitor students' learning progress by reviewing their conversations with the GPTs. This README includes step-by-step instructions, covering everything from setting up a LINE Official Account and customizing your GPTs, to deploying the LINE Bot on Google Cloud Run for student access.

NOTE:
To have you understand how to set things up better, I use videos on YouTube to guide you through some processes i.e. creating miscellaneous accounts. If you have any questions, feel free to shoot me an email.

Prerequisites

  • Basic understanding of GPT-4 or GPT-3 (REQUIRED so that you won't abuse them)
  • I will take care of the rest : ).

Table of Contents

Setting Up a LINE Official Account

  1. Watch this video to set up your official account first

  2. Then ensure your configuration is the same as the ones below:

    • settings > reply settings > reply function

      reply-settings

    • settings > reply settings > ways of reply

      ways-of-reply

  3. Go to Messaging API and copy your Channel Secret and Access Token for later use.

Setting Up an OpenAI API Account

Creating an OpenAI Account

  1. Go to https://platform.openai.com/docs/overview and sign up for an account.
  2. Set up your payment method.

Understanding API Pricing

Before integrating GPT-4 into your pedagogy, it's crucial to understand the pricing model of the OpenAI API. This subsection explains the cost associated with API requests.

NOTE:
Chinese characters usually count as 2 tokens, so be careful if your students are mandarin-speakers.

Creating an API Key

An API key is necessary to authenticate your requests to OpenAI. This part walks you through creating an API key so you can start customizing and using GPT models in your teaching.

  1. How to get your API key?
  2. Copy your API key and save it for later use.

Customizing Your GPT

Learn how to tailor GPT-4's responses to suit your educational content and objectives. This includes adjusting settings for tone, complexity, and relevance to your curriculum.

  1. Customizing your GPT

  2. Copy your model ID and save it for later use.

    model-id

Setting Up a Firebase Account

Setting Up a Firestore Project

  1. Go to Firebase and log in your google account.

  2. Click Create a project and follow the instructions to create a new project.

    create-project

  3. Enter your project name, and agree to the terms and conditions.

    project-name

  4. Uncheck the Google Analytics box and click Create Project.

    google-analytics

  5. Click Cloud Firestore and Create Database.

    create-database

    create-database

  6. Choose the data center closest to your location and click Next.

    choose-location

  7. Choose Start in production mode and click Create.

    start-in-production-mode

  8. Click Start collection, name the collection users, and click Next.

    start-collection

  9. Click Auto-ID and Save.

    auto-id

Storing Service Account Credentials

  1. Go to Project Settings and click Service Accounts.

    project-settings

  2. Click Generate new private key and save the JSON file for later use.

    generate-new-private-key

Why do I need firebase?
According to the official documentation of the LINE Messaging API, there IS NOT an API available for retrieving text content. Consequently, it's necessary to have a storage solution for archiving the responses sent by students. This setup ensures that when students quote specific messages, our custom GPTs can understand the context they are referencing.

Setting Up a GitHub Account

To allow Google Cloud Run to deploy your LINE Bot, you'll need to fork this repository. This section covers the steps to set up a GitHub account and fork this repository.

Setting Up a Google Cloud Account

To deploy your LINE Bot, you'll need a Google Cloud Account. This section details the signup process and initial configuration steps to get your account ready for deployment.

Creating a Cloud Run Service

... to be added

About

A chatgpt-based linebot for teaching badminton rules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published