Skip to content

aaryavbehl/ai-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alt text

HackAI

  • HackAI is a chatbot powered by the Hack Club API. The project consists of a frontend and a backend.

Backend

  • An additional backend was required for this project since a static HTML frontend cannot directly communicate with outside APIs and display them due to (CORS) policy.

Frontend

  • The frontend consists of a basic form used to communicate with the API and get back messages.

  • It also has a few buttons to demonstrate how easy it is to work with this API.


API Endpoints

POST /api/chat

  • Description: Sends a message to the API and receives a response.

  • Request Body(JSON):

{
    "message": "Hello!"
}
  • Request Response(JSON) - Example
{
     "bot": = "Hi there! How can I assist you?"
}

How to Run Locally

  1. Clone the repository:
git clone https://github.com/aaryavbehl/ai-chatbot.git
cd ai-chatbot
  1. Install Modules

    • pip install -r requirements.txt
  2. Run the Flask server

    • python app.py
  3. Access the Frontend