This repository contains a simple Panel application that provides an interactive interface to communicate with OpenAI's ChatGPT.
Panel is a high-level app and dashboarding solution for Python that makes it easy to create custom web applications with a variety of widgets.
- Python 3.7 or higher
- An OpenAI API key for accessing ChatGPT. You can obtain one by signing up on the OpenAI platform.
Clone this repository to your local machine:
bash
git clone https://github.com/yourusername/chatgpt_panel.git
cd chatgpt_panel
Create a conda environment based on the provided environment.yaml
file:
bash
conda env create -f environment.yaml
Activate the created environment:
bash
conda activate panelchat
Create a new file named .env
in the project directory:
bash
touch .env
Add your OpenAI API key to the .env
file:
OPENAI_API_KEY=your_api_key_here
Replace your_api_key_here
with your actual OpenAI API key. The application will read the API key from the environment variable stored in the .env
file.
Start the Panel server and launch the application:
bash
panel serve src/app.py
The application will open in your default web browser at http://localhost:5006/app
.
The web interface provides an input field and a "Send" button. Type your message in the input field and click the "Send" button or press Enter to send your message to ChatGPT. The response from ChatGPT will appear in the text area above the input field.
Be aware of the costs and rate limits associated with using the OpenAI API. Each interaction with the ChatGPT API will count towards your usage limits.
- This readme was partially generated by chatGPT. *