Skip to content

"Build a conversational chatbot effortlessly using Python and the OpenAI API. Quick responses to prompts make chatbot development a breeze."

Notifications You must be signed in to change notification settings

shashankatthaluri/create-simple-chatbot-in-2min

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Simple ChatGPT Chatbot in Python 🤖

This is a simple implementation of a chatbot using the OpenAI API and Python. With just a few lines of code, you can create a conversational chatbot that can respond to your prompts. 💬

Prerequisites 📋

Before running this code, make sure you have the following:

Usage 🚀

  1. Open the simple_chatbot.py file and replace "YOUR API KEY GOES HERE" with your actual OpenAI API key.

  2. Run the script:

python simple_chatbot.py
  1. The script will prompt you to enter your message. Type your message and press Enter. 💬

  2. The chatbot will respond with its generated response based on your input. 🔊

  3. To exit the chatbot, type quit, exit, or bye. 🚪

How It Works ⚙️

The script defines a chat_gpt_ function that takes a prompt as input and uses the OpenAI API to generate a response. The response is then printed to the console.

The main loop of the script continuously prompts the user for input. When the user types quit, exit, or bye, the loop breaks, and the script terminates.

With this simple implementation, you can quickly set up a chatbot and experiment with the OpenAI API. 🎉

About

"Build a conversational chatbot effortlessly using Python and the OpenAI API. Quick responses to prompts make chatbot development a breeze."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages