Skip to content

A simple AI Chatbot built in Python that uses the OpenAI API to generate responses to user prompts via a command-line interface.

Notifications You must be signed in to change notification settings

whitehathackerpr/AI-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

AI Chatbot

A simple AI Chatbot built in Python that uses the OpenAI API to generate responses to user prompts via a command-line interface.

Features

  • OpenAI Integration: Uses the OpenAI API to generate responses.
  • CLI Interface: Easily interact with the chatbot using the command line.
  • Simple Setup: Minimal dependencies and quick to get started.

Requirements

  • Python 3.7+
  • An OpenAI API key

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/AI-Chatbot.git
    cd AI-Chatbot

Set up a virtual environment (optional but recommended):

bash Copy Edit python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate Install dependencies:

bash Copy Edit pip install -r requirements.txt Set your OpenAI API key as an environment variable:

bash Copy Edit export OPENAI_API_KEY='your_openai_api_key_here' (On Windows, use set instead of export.)

Usage Run the chatbot by executing:

bash Copy Edit python chatbot.py You will be prompted to enter your message. The chatbot will then respond using the OpenAI API.

Contributing Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.

License This project is licensed under the MIT License.

yaml Copy Edit


Next Steps

  • Enhancements:
    • Add a conversational history to maintain context between messages.
    • Implement a graphical user interface (GUI) using Tkinter or PyQt.
    • Enhance error handling and add logging for better debugging.

This guide should provide you with a solid foundation for your AI Chatbot project. Feel free to extend and customize the chatbot to suit your needs!

About

A simple AI Chatbot built in Python that uses the OpenAI API to generate responses to user prompts via a command-line interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages