Skip to content

huusonno1/ChatBotusingOpenAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatBot using OpenAI

A simple chatbot implementation using OpenAI's API.

Prerequisites

  • Python 3.x
  • PyCharm IDE (recommended)
  • OpenAI API key

Installation

  1. Clone the repository and open it in PyCharm.

  2. Set up a virtual environment (venv):

    • In PyCharm, go to File → Settings → Project → Python Interpreter
    • Click the gear icon and select "Add"
    • Choose "Virtual Environment" and select the location and base interpreter
    • For detailed instructions, visit: PyCharm Virtual Environment Setup
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the data manager:

    python data_manager.py

    Note: You can modify the data as needed.

Configuration

  1. Configure the Run Configuration in PyCharm:

    • Click "Add Configuration" or "Edit Configurations"
    • Set the Application file to: [your_project_path]/ChatBotusingOpenAI/app/main.py
    • Select the Python interpreter to use your newly created virtual environment
    • image
    • image
  2. Create a .env file in the root directory with your OpenAI API key:

    OPENAI_API_KEY=your_api_key_here
    
    • image

Running the Application

  1. Click the Run button in PyCharm or use the following command in terminal:

    python app/main.py
    • image
  2. Access the application at: http://127.0.0.1:8000/

Screenshots

The application interface provides a clean chat interface where you can interact with the OpenAI-powered chatbot.

  • image

Note

Make sure to keep your API key confidential and never commit the .env file to version control.

Contributing

Feel free to submit issues and enhancement requests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published