abdur75648 / ChatGPT-API-Python

Building a Chatbot in Python using OpenAI's Official ChatGPT API

Home Page:https://abdur75648.github.io/ChatGPT-API-Python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ€– ChatGPT-API-Python: Building a Chatbot using OpenAI's ChatGPT API πŸš€

ChatGPT-API-Python Website

This repository contains code for building a terminal-based chatbot using OpenAI's recently released ChatGPT API Released on 01/03/2023. The code is written in Python and uses the OpenAI Python library

Screenshot 2023-03-02 at 4 09 46 PM

Getting Started πŸ”§

Before you begin, you'll need to sign up for an OpenAI API key. You can sign up here and get your API key here.

Once you have your API key, you can install the openai library using pip:

pip install openai

You will need to replace the API Key in the code in order to run the chatbot

  • You can do this by replacing the value of the variable openai.api_key with your API key, in the file chat.py line 3

Usage πŸ’¬

To start the chatbot, run the following command:

python chat.py

You can enter your prompts and the chatbot will generate responses. It will continue to respond until you enter the message exit to exit the program. You can also enter clear to clear the chat history and start a new conversation.

Happy chatting πŸŽ‰

References

Connect with me

Name: Abdur Rahman

Institution: Indian Institute of Technology Delhi

Find me on:

  • LinkedIn
  • GitHub
  • Twitter

About

Building a Chatbot in Python using OpenAI's Official ChatGPT API

https://abdur75648.github.io/ChatGPT-API-Python/


Languages

Language:Python 96.9%Language:HTML 3.1%